Skip to content

Divider

A Divider is a thin line that creates separation between two UI elements, separating content into clear groups of lists and layouts, with a role="separator".

Import

import { Divider } from "@cfa/react-core";

Live Editor

Examples

Default

Orientation

By default the Divider’s orientation is set to "horizontal".

Set the orientation prop to "vertical", to vertically separate content. The Divider’s must be in a child of a flex parent with flex-direction: row when set to "vertical".

Props

Visit the Documentation Site for the full list of props.

NameTypeDefaultDescription
aria-describedbystring-Identifies the element (or elements) that describes the object.
aria-detailsstring-Identifies the element (or elements) that provide a detailed, extended description for the object.
aria-labelstring-Defines a string value that labels the current element.
aria-labelledbystring-Identifies the element (or elements) that labels the current element.
classNamestring'react-aria-Separator'The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.
dirstring--
elementTypestring-The HTML element type that will be used to render the separator.
hiddenboolean--
idstring-The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).
inertboolean--
langstring--
onAnimationEndAnimationEventHandler<HTMLElement>--
onAnimationEndCaptureAnimationEventHandler<HTMLElement>--
onAnimationIterationAnimationEventHandler<HTMLElement>--
onAnimationIterationCaptureAnimationEventHandler<HTMLElement>--
onAnimationStartAnimationEventHandler<HTMLElement>--
onAnimationStartCaptureAnimationEventHandler<HTMLElement>--
onAuxClickMouseEventHandler<HTMLElement>--
onAuxClickCaptureMouseEventHandler<HTMLElement>--
onClickMouseEventHandler<HTMLElement>--
onClickCaptureMouseEventHandler<HTMLElement>--
onContextMenuMouseEventHandler<HTMLElement>--
onContextMenuCaptureMouseEventHandler<HTMLElement>--
onDoubleClickMouseEventHandler<HTMLElement>--
onDoubleClickCaptureMouseEventHandler<HTMLElement>--
onGotPointerCapturePointerEventHandler<HTMLElement>--
onGotPointerCaptureCapturePointerEventHandler<HTMLElement>--
onLostPointerCapturePointerEventHandler<HTMLElement>--
onLostPointerCaptureCapturePointerEventHandler<HTMLElement>--
onMouseDownMouseEventHandler<HTMLElement>--
onMouseDownCaptureMouseEventHandler<HTMLElement>--
onMouseEnterMouseEventHandler<HTMLElement>--
onMouseLeaveMouseEventHandler<HTMLElement>--
onMouseMoveMouseEventHandler<HTMLElement>--
onMouseMoveCaptureMouseEventHandler<HTMLElement>--
onMouseOutMouseEventHandler<HTMLElement>--
onMouseOutCaptureMouseEventHandler<HTMLElement>--
onMouseOverMouseEventHandler<HTMLElement>--
onMouseOverCaptureMouseEventHandler<HTMLElement>--
onMouseUpMouseEventHandler<HTMLElement>--
onMouseUpCaptureMouseEventHandler<HTMLElement>--
onPointerCancelPointerEventHandler<HTMLElement>--
onPointerCancelCapturePointerEventHandler<HTMLElement>--
onPointerDownPointerEventHandler<HTMLElement>--
onPointerDownCapturePointerEventHandler<HTMLElement>--
onPointerEnterPointerEventHandler<HTMLElement>--
onPointerLeavePointerEventHandler<HTMLElement>--
onPointerMovePointerEventHandler<HTMLElement>--
onPointerMoveCapturePointerEventHandler<HTMLElement>--
onPointerOutPointerEventHandler<HTMLElement>--
onPointerOutCapturePointerEventHandler<HTMLElement>--
onPointerOverPointerEventHandler<HTMLElement>--
onPointerOverCapturePointerEventHandler<HTMLElement>--
onPointerUpPointerEventHandler<HTMLElement>--
onPointerUpCapturePointerEventHandler<HTMLElement>--
onScrollUIEventHandler<HTMLElement>--
onScrollCaptureUIEventHandler<HTMLElement>--
onTouchCancelTouchEventHandler<HTMLElement>--
onTouchCancelCaptureTouchEventHandler<HTMLElement>--
onTouchEndTouchEventHandler<HTMLElement>--
onTouchEndCaptureTouchEventHandler<HTMLElement>--
onTouchMoveTouchEventHandler<HTMLElement>--
onTouchMoveCaptureTouchEventHandler<HTMLElement>--
onTouchStartTouchEventHandler<HTMLElement>--
onTouchStartCaptureTouchEventHandler<HTMLElement>--
onTransitionCancelTransitionEventHandler<HTMLElement>--
onTransitionCancelCaptureTransitionEventHandler<HTMLElement>--
onTransitionEndTransitionEventHandler<HTMLElement>--
onTransitionEndCaptureTransitionEventHandler<HTMLElement>--
onTransitionRunTransitionEventHandler<HTMLElement>--
onTransitionRunCaptureTransitionEventHandler<HTMLElement>--
onTransitionStartTransitionEventHandler<HTMLElement>--
onTransitionStartCaptureTransitionEventHandler<HTMLElement>--
onWheelWheelEventHandler<HTMLElement>--
onWheelCaptureWheelEventHandler<HTMLElement>--
orientationOrientation'horizontal'The orientation of the separator.
renderDOMRenderFunction<"hr" | "div", undefined>-Overrides the default DOM element with a custom render function. This allows rendering existing components with built-in styles and behaviors such as router links, animation libraries, and pre-styled components. Requirements: * You must render the expected element type (e.g. if `<button>` is expected, you cannot render an `<a>`). * Only a single root DOM element can be rendered (no fragments). * You must pass through props and ref to the underlying DOM element, merging with your own prop as appropriate.
slotstring-A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent.
styleCSSProperties-The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element.
translate"yes" | "no"--