Cover
Use Cover to to expand and fill up the whole area of the parent which has position: relative using the ::before pseudo element.
Combine this component with other interactive controls like Checkbox, Link, or Button to allow interacting with an element while also having nested controls inside that element.
Want to skip the docs? Try our MCP Server
#
Documentation
#
#
Usage
#
import { Button, Cover, Group, Link } from "@optiaxiom/react";
import { IconStar } from "@tabler/icons-react";
export function App() {
return (
<Group
border="1"
fontSize="md"
gap="16"
justifyContent="space-between"
px="24"
py="16"
rounded="md"
style={{ position: "relative" }}
w="224"
>
<Cover asChild>
<Link appearance="subtle" href="data:," rounded="inherit">
Primary Link
</Link>
</Cover>
<Button appearance="subtle" icon={<IconStar />} />
</Group>
);
}#
Props
#
#
Cover
#
Supports all Box props in addition to its own. Renders a <div> element.
Prop |
|---|
asChildChange the default rendered element for the one passed as a child, merging their props and behavior. Read the Composition guide for more details.
|
className
|
disabledWhether to expand and fill up the whole area of the parent which has
Default: |
insetWhether to offset the outline or not.
Default: |
#
Changelog
#
#
1.4.0
#
- Added component