Concepts
OverviewCompositionTestingLayout
Aspect RatioBleedBoxCenterContainerDividerFlexFloatGridLink OverlayScrollableStackWrapComponents
AccordionAdmonitionAvatarButtonCheckboxComboboxConfirm ModalCTAModalDate PickerDialogFieldFieldsetFile UploaderIcon ButtonInputLoading StatesMenuNotificationsProgressPrompt ModalRadioRatingSelectSwitchTableTabsTagTextTextareaToggleTooltipUtilities
Feature FlagsForLocal StoragePortalShowsplitPropsTheme1import { Divider, Box, HStack } from "styled-system/jsx";2import { DecorativeBox } from "compositions/lib/decorative-box";3
4const Demo = () => {5 return (6 <HStack gap="md">7 <DecorativeBox height="20">Left</DecorativeBox>8 <Divider />9 <DecorativeBox height="20">Right</DecorativeBox>10 </HStack>11 );12};
Usage
1import { Divider } from "styled-system/jsx";
1<Divider />
Examples
Orientation
Use the orientation
prop to change the orientation of the divider.
1import { Divider, VStack } from "styled-system/jsx";2import { DecorativeBox } from "compositions/lib/decorative-box";3
4const Demo = () => {5 return (6 <VStack gap="8">7 <Divider orientation="horizontal" />8 <Divider orientation="vertical" />9 </VStack>10 );11};
Thickness
Use the thickness
prop to change the thickness of the divider.
1import { Divider, VStack } from "styled-system/jsx";2import { DecorativeBox } from "compositions/lib/decorative-box";3
4const Demo = () => {5 return (6 <VStack gap="8">7 <Divider thickness="1px" />8 <Divider thickness="2px" />9 <Divider thickness="4px" />10 </VStack>11 );12};
Color
Use the color
prop to change the color of the divider.
1import { Divider, VStack } from "styled-system/jsx";2import { DecorativeBox } from "compositions/lib/decorative-box";3
4const Demo = () => {5 return (6 <VStack gap="8">7 <Divider color="gray.200" />8 <Divider color="blue.500" />9 <Divider color="red.500" />10 </VStack>11 );12};
Props
Prop | Type | Description |
---|---|---|
orientation | horizontal,vertical | The orientation of the divider. Defaults to "horizontal" . |
thickness | string | The thickness of the divider. Defaults to "1px" . |
color | string | The color of the divider. Defaults to "gray.200" . |
On this page