HextaUI

Card: Long content

Unbroken titles, long URLs, emoji and CJK text wrap inside a narrow card instead of pushing it wider.

Supercalifragilisticexpialidocious_unbroken_title_that_never_ends
https://example.com/a/very/long/path/that/keeps/going/and/going?with=query

👩‍👩‍👧‍👦 你好世界,这是一个很长的中文句子用于测试换行

import { Button } from "@/components/ui/button"
import {
  Card,
  CardAction,
  CardContent,
  CardDescription,
  CardFooter,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"

export function CardLongContent() {
  return (
    <Card size="sm" className="w-72 max-w-full">
      <CardHeader>
        <CardTitle>
          Supercalifragilisticexpialidocious_unbroken_title_that_never_ends
        </CardTitle>
        <CardDescription>
          https://example.com/a/very/long/path/that/keeps/going/and/going?with=query
        </CardDescription>
        <CardAction>
          <Button variant="outline" size="sm">
            Edit
          </Button>
        </CardAction>
      </CardHeader>
      <CardContent>
        <p>👩‍👩‍👧‍👦 你好世界,这是一个很长的中文句子用于测试换行</p>
      </CardContent>
      <CardFooter>
        <Button variant="outline">Cancel</Button>
        <Button>Continue</Button>
      </CardFooter>
    </Card>
  )
}

This adds the example as components/examples/card/long-content.tsx, together with the Card component and the HextaUI theme tokens it needs.

pnpm dlx shadcn@latest add https://hextaui.com/r/card-long-content.json

To add only the component, follow the Card installation.

Props in this example

The Card props this example sets, from the API reference.

PropTypeDefault
sizeScales spacing, radius and title size together.
"default" | "sm" | "flush""default"

Every prop is in the Card API reference.

See them all, with keyboard support and accessibility notes, on the Card page.