-
Notifications
You must be signed in to change notification settings - Fork 0
Card
Nariman Bortov edited this page Jul 2, 2023
·
3 revisions
import { Card, CardBody } from '@narimanb/wreactui'
Code
<Card>
<CardBody>
<p className="mb-4 font-semibold text-gray-600 dark:text-gray-300">Revenue</p>
<p className="text-gray-600 dark:text-gray-400">
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Fuga, cum commodi a omnis numquam
quod? Totam exercitationem quos hic ipsam at qui cum numquam, sed amet ratione! Ratione, nihil
dolorum.
</p>
</CardBody>
</Card>
The Card
component defines some very basic styles, like background color and borders.
Code
<Card>Lorem ipsum dolor sit amet</Card>
The Card
component background colors can be overwritten by using the prop colored
and setting new colors using a className
.
Code
<Card colored className="bg-purple-600">
<CardBody>
<p className="mb-4 font-semibold text-white">Revenue</p>
<p className="text-white">
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Fuga, cum commodi a omnis numquam
quod? Totam exercitationem quos hic ipsam at qui cum numquam, sed amet ratione! Ratione, nihil
dolorum.
</p>
</CardBody>
</Card>
The CardBody
component also define some very basic styles (literally, it's just a p-4
) and is required for a nice looking card. The benefit of not applying too much styling is that you get a very flexible component.
Code
<Card className="flex h-48">
<img className="object-cover w-1/3" src="/img/forest.jpeg" />
<CardBody>
<p className="mb-4 font-semibold text-gray-600 dark:text-gray-300">Revenue</p>
<p className="text-gray-600 dark:text-gray-400">
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Fuga, cum commodi a omnis numquam
quod? Totam exercitationem quos hic ipsam at qui cum numquam, sed amet ratione! Ratione, nihil
dolorum.
</p>
</CardBody>
</Card>
Prop | Description | Type | Default |
---|---|---|---|
colored |
remove the default background colors | boolean |
Original source: Estevan Maito https://windmillui.com/react-ui