Using Grommet for HPE?See Menu examples and guidance.
string
"a user friendly label for screen readers"
string
"start"
"center"
"end"
"stretch"
"baseline"
function
(props) => <Box ...>{...}</Box>
node
<Box> <CaretNext /> <Text>Open Me</Text> </Box>
object
The keys correspond to a side of the drop down. The values correspond to a side of the control. For instance, {left: 'left', top: 'bottom'} would align the left edges and the top of the drop down to the bottom of the control. At most one of left or right and one of top or bottom should be specified.
{ top: "top" | "bottom", bottom: "top" | "bottom", right: "left" | "right", left: "left" | "right" }
{ top: "top", left: "left" }
string
"neutral-1"
object
{ color: "neutral-1", opacity: "medium" }
"weak"
"medium"
"strong"
true
object
ref.current
label
, onClick
, and href
.array[object]
[ { label: 'Item 1', onClick: () => {}, }, { label: <Box alignSelf="center">Github</Box>, icon: (<Github />), } ]
array[array[object]]
[ [ { label: 'Item 1' }, { label: 'Item 2' }, ], [ { label: 'Item 3' }, ] ]
string
"start"
"center"
"end"
"between"
"around"
"stretch"
string
"none"
"xxsmall"
"xsmall"
"small"
"medium"
"large"
"xlarge"
object
{ vertical: "...", horizontal: "...", top: "...", bottom: "...", left: "...", right: "..." }
object
{ openMenu: "Open Menu", closeMenu: "Close Menu" }
At its core, the Menu component is a regular <button> element. Thus, both DOM and React properties, methods, and events are accessible. To read up on all of the possible DOM attributes and types available for button elements, check out this MDN Web Documents page. To learn more about DOM events and methods, you can read more on the MDN Web Events documentation page.
Also, feel free to read about the types of React events available, or see how DOM attributes change in React. Working in tandem with Styled Components, you also have access to the as property.