Grapes homepage1.57.0
  • Guide
  • Tokens
  • Components
    Grapes on GithubGrapes on Figma
    Interaction
    • Button
    • IconButton
    • FloatingActionBar
    • Link
    Icons
    • Icon
    • HighlightIcon
    Form
    • AmountInput
    • Autocomplete
    • AutocompleteMultiple
    • AutocompletePlace
    • CheckboxBox
    • CheckboxField
    • DatePicker
    • FormField
    • Input
    • OptionGroup
    • PasswordInput
    • PhoneInput
    • RadioBox
    • RadioField
    • RadioGroup
    • Select
    • SwitchField
    • TextArea
    • TextInput
    • Upload
    • UploadButton
    Feedback
    • Badge
    • Banner
    • Callout
    • EmptyState
    • Modal
    • ModalSlideshow
    • DeprecatedModalSlideshow
    • PageModal
    • Skeleton
    • Tag
    • Toast
    • Tooltip
    Data display
    • Accordion
    • Avatar
    • Box
    • Calendar
    • CalendarRange
    • CollapsibleList
    • FileCard
    • InfoTip
    • ListBox
    • ListView
    • Panel
    • SidePanel
    • DeprecatedPreview
    • Table
    • Timeline
    • useDateFormatter
    Navigation
    • DropdownItem
    • DropdownMenu
    • Navigation
    • NavigationItem
    • Popover
    • Tabs

    DeprecatedPreview

    This component is used to display a condensed view of an entity. If it is clickable, we expect to see a detailed version.

    View source code
    • Usage
    • Props
    Deprecation warning

    This component is being deprecated in favor of two components: CardLink and FileCard. The CardLink component is still being created, but you can already use the FileCard component if you need to display a file.

    Basic usage

    The rightAddon prop is used to add a component on the right of the DeprecatedPreview component. To add a callback to the component, for example to open a modal or redirect to another page, you can use the onClick prop.

    <DeprecatedPreview
      primaryText="Uploaded on November 4, 2020"
      rightAddon={
        <Icon
          aria-hidden="true"
          color="var(--grapes-color-content-decorative-icon)"
          name="magnifying-glass"
        />
      }
      onClick={() => {}}
    />
    

    Icon

    The iconName prop is used to add a HighlightIcon component to the left of the Preview component.

    <DeprecatedPreview iconName="receipt-checked" {...otherProps} />
    

    Secondary text

    The secondaryText prop allows you to specify a secondary text to display. You can use a string or a component as the secondary text.

    <DeprecatedPreview
      primaryText="€400.00"
      secondaryText="From your bank"
      {...otherProps}
    />
    

    Overflowing secondary text

    If the fit prop is set to parent and the content in the secondary text overflows, an ellipsis will appear.

    <div className="w-[360px]">
      <DeprecatedPreview
        fit="parent"
        secondaryText="Lorem ipsum dolor sit amet, consectetur adipiscing elit."
        {...otherProps}
      />
    </div>
    

    Highlighted

    The isHighlighted prop lets you specify whether the Preview component should be highlighted.

    <DeprecatedPreview isHighlighted {...otherProps} />