UIKit
7.39.0
• ArrowToggleComposants
UIKit
7.39.0
AccordionActionTooltipActionsPanelAlertArrowToggleAvatarBreadcrumbsButtonCardCheckboxClipboardButtonDefinitionListDialogDisclosureDividerDrawerDropdownMenuFilePreviewHelpMarkHotkeyIconLabelLinkListLoaderMenuModalNumberInputOverlayPaginationPalettePasswordInputPinInputPlaceholderContainerPopoverPopupPortalProgressRadioRadioGroupSegmentedRadioGroupSelectSheetSkeletonSliderSpinStepperSwitchTableTabsTextTextAreaTextInputToasterTocTooltipUserUserLabel
Date Components
3.4.2
Navigation
4.0.16
ArrowToggle
Responsable :
Marginy605
direction
size
ArrowToggle is a component for displaying the chevron icon. It can rotate in four directions and can be used to display drop-down lists, cut components, etc.
§Appearance
ArrowToggle has four possible directions: top, right, bottom, and left.
import {ArrowToggle} from '@gravity-ui/uikit'; export default function () { return ( <> <ArrowToggle direction="top" /> top <ArrowToggle direction="right" /> right <ArrowToggle direction="bottom" /> bottom <ArrowToggle direction="left" /> left </> ); }
§Size
import {ArrowToggle} from '@gravity-ui/uikit'; export default function () { return ( <> <ArrowToggle size={10} /> 10 <ArrowToggle size={20} /> 20 <ArrowToggle size={30} /> 30 <ArrowToggle size={40} /> 40 <ArrowToggle size={50} /> 50 <ArrowToggle size={100} /> 100 </> ); }
§Use as an interactive element
Here is an example of using ArrowToggle with a toggling icon:
import {useState} from 'react'; import type {ArrowToggleProps} from '@gravity-ui/uikit'; import {ArrowToggle, Button} from '@gravity-ui/uikit'; const directions = ['top', 'left', 'bottom', 'right'] as Array<ArrowToggleProps['direction']>; export default function () { const [directionIndex, setDirectionIndex] = useState(0); const direction = directions[directionIndex % directions.length]; return ( <Button onClick={() => setDirectionIndex(directionIndex + 1)} view="flat"> <ArrowToggle direction={direction} /> <span>{direction}</span> </Button> ); }
§Properties
| Name | Description | Type | Default |
|---|---|---|---|
| className | class HTML attribute | string | |
| direction | Used to set the arrowToggle direction | string | "bottom" |
| size | arrowToggle size (in pixels) | number | 16 |
| qa | data-qa HTML attribute, used for testing | string |
§CSS API
| Name | Description |
|---|---|
--g-arrow-toggle-transition-duration | Transition duration |