Item component is a straightforward flex container that can house nearly any type of content. Use it to display a title, description, and actions. Group it with the ItemGroup component to create a list of items.
You can pretty much achieve the same result with the div element and some classes, but I’ve built this so many times that I decided to create a component for it. Now I use it all the time.
Installation
- CLI
- Manual
Usage
Item vs Field
Use Field if you need to display a form input such as a checkbox, input, radio, or select. If you only need to display content such as a title, description, and actions, useItem.
Examples
Variants
TheItem component supports different visual variants for various use cases.
Size
TheItem component has different sizes for different use cases. For example, you can use the sm size for a compact item or the default size for a standard item.
Icon
Display an icon alongside your item content.Avatar
Include an avatar in your item layout.Image
Display an image within the item component.Group
UseItemGroup to create a list of items.
Header
Add a header to your item for additional context.Link
To render an item as a link, use thechild snippet. The hover and focus states will be applied to the anchor element.