ListItem
Install
yarn add @ntds/list
Import
import { ListItem } from '@ntds/list';
Props
ListItem
Prop | Type & Description |
---|---|
label | string Main label text displayed in the cell |
icon | any Optional icon displayed before the label |
onClick | () => void Called when the item is clicked |
details | ReactNode Optional extra text or badge displayed after the label |
isExternal | boolean Displays an external link icon on the right side that opens the URL in a new tab |
render | (props: Omit<BaseButtonProps, "render" | "type" | "hoverAffordance" | "elementRef" | "tw">) => Element Hook into the top render method of the wrapping element With internal link: render={props => <a href='/' {...props} />} With external link: render={props => <a rel='noreferrer' target='_blank' href='/' {...props} />} |