Card can leverage the max-width property. Learn more in our visual guidelines.
Add a background color by passing the color name to background. List of all colors can be viewed here under Product Colors and Status: Subtle Variations.
import React from 'react' import Title from 'playbook-ui' import { Body } from 'playbook-ui' import Card from 'playbook-ui' const CardBackground = (props) => { return ( <div> <Title marginBottom="sm" size={4} tag="h4" text="Card Colors" /> <Card background="dark" dark marginBottom="sm" > <Body dark text="Dark" /> </Card> <Card marginBottom="sm" > <Body text="White / Default" /> </Card> <Card background="light" marginBottom="sm" > <Body text="Light"/> </Card> <Title marginBottom="sm" size={4} tag="h4" text="Product Colors" /> <Card background="product_1_background" marginBottom="sm" > <Body dark text="Product 1 Background" /> </Card> <Card background="product_7_highlight" marginBottom="sm" > <Body dark text="Product 7 Highlight" /> </Card> <Card background="product_2_highlight" marginBottom="sm" > <Body dark text="Product 2 Highlight" /> </Card> <Title marginBottom="sm" size={4} tag="h4" text="Subtle Status Colors" /> <Card background="success_subtle" marginBottom="sm" > <Body text="Success Subtle" /> </Card> <Card background="warning_subtle" marginBottom="sm" > <Body text="Warning Subtle" /> </Card> <Card background="info_subtle" marginBottom="sm" > <Body text="Info Subtle" /> </Card> </div> ) } export default CardBackground
Card highlight can pass status, product, and category colors. List of all colors can be viewed here.
import React from 'react' import Card from 'playbook-ui' const CardHighlight = (props) => { return ( <div> <Card highlight={{ position: 'side', color: 'product_6_highlight' }} marginBottom="sm" > {'Side Position & Product 6 Highlight Color'} </Card> <Card highlight={{ position: 'top', color: 'warning' }} marginBottom="sm" > {'Top Position & Warning Color'} </Card> <Card highlight={{ position: 'side', color: 'category_2' }} > {'Side Position & Category 2 Color'} </Card> </div> ) } export default CardHighlight
Card headers pass category, product, and background colors only. List of all category, product, and background colors can be viewed here.
import React from 'react' import Card from 'playbook-ui' import Title from 'playbook-ui' import Body from 'playbook-ui' const CardHeader = (props) => { return ( <> <Title marginBottom='sm' size={4} tag="h4" text="Category Colors" /> <Card marginBottom='sm' padding="none" > <Card.Header headerColor="category_1" > <Body dark text="Category 1" /> </Card.Header> <Card.Body> <Body text="Body" /> </Card.Body> </Card> <Card marginBottom='sm' padding="none" > <Card.Header headerColor="category_3" > <Body text="Category 3" /> </Card.Header> <Card.Body padding="md" > <Body text="Body" /> </Card.Body> </Card> <Title marginBottom='sm' size={4} tag="h4" text="Product Colors" /> <Card marginBottom='sm' padding="none" > <Card.Header headerColor="product_2_background" > <Body dark text="Product 2 Background" /> </Card.Header> <Card.Body> <Body text="Body" /> </Card.Body> </Card> <Card marginBottom='sm' padding="none" > <Card.Header headerColor="product_6_background" > <Body dark text="Product 6 Background" /> </Card.Header> <Card.Body> <Body text="Body" /> </Card.Body> </Card> <Title marginBottom='sm' size={4} tag="h4" text="Background Colors" /> <Card marginBottom='sm' padding="none" > <Card.Header headerColor="white" > <Body text="White" /> </Card.Header> <Card.Body> <Body text="Body" /> </Card.Body> </Card> <Card marginBottom='sm' padding="none" > <Card.Header headerColor="dark" > <Body dark text="Dark" /> </Card.Header> <Card.Body> <Body text="Body" /> </Card.Body> </Card> <Title marginBottom='sm' size={4} tag="h4" text="Striped Colors" /> <Card marginBottom='sm' padding="none" > <Card.Header headerColor="category_1" headerColorStriped > <Body dark text="Striped Category 1" /> </Card.Header> <Card.Body> <Body text="Body" /> </Card.Body> </Card> </> ) } export default CardHeader
import React from 'react' import Card from 'playbook-ui' const CardTag = (props) => { return ( <div> <Card tag="section" > {'section'} </Card> <br /> <Card tag="footer" > {'footer'} </Card> <br /> <Card tag="header" > {'header'} </Card> <br /> <Card tag="article" > {'article'} </Card> <br /> <Card tag="aside" > {'aside'} </Card> <br /> <Card tag="main" > {'main'} </Card> <br /> <Card tag="nav" > {'nav'} </Card> </div> ) } export default CardTag
import React from 'react' import Card from 'playbook-ui' const CardPadding = (props) => { return ( <div> <Card padding="none" > {'Card content'} </Card> <br /> <Card padding="xs" > {'Card content'} </Card> <br /> <Card padding="sm" > {'Card content'} </Card> <br /> <Card padding="md" > {'Card content'} </Card> <br /> <Card padding="lg" > {'Card content'} </Card> <br /> <Card padding="xl" > {'Card content'} </Card> <br /> </div> ) } export default CardPadding
import React from 'react' import Card from 'playbook-ui' const CardShadow = (props) => { return ( <div> <Card shadow="none" > {'Card content'} </Card> <br /> <Card shadow="deep" > {'Card content'} </Card> <br /> <Card shadow="deeper" > {'Card content'} </Card> <br /> <Card shadow="deepest" > {'Card content'} </Card> <br /> </div> ) } export default CardShadow
import React from 'react' import Card from 'playbook-ui' const CardContent = (props) => { return ( <div> <Card cursor="pointer" > {'Card content'} </Card> <br /> <Card > {`Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec iaculis, risus a fringilla luctus, sapien eros sodales ex, quis molestie est nulla non turpis. Vestibulum aliquet at ipsum eget posuere. Morbi sed laoreet erat. Sed commodo posuere lectus, at porta nulla ornare a. Suspendisse quam est, sollicitudin ut enim sit amet, commodo placerat enim. Donec laoreet metus ac mauris pellentesque mattis. Pellentesque luctus vel mauris non aliquam. Mauris hendrerit mattis porttitor. Curabitur vehicula justo non ex consectetur commodo. Quisque posuere aliquet quam. Maecenas malesuada magna mauris, ac tempor metus euismod at. Cras ornare fermentum magna mollis efficitur. Sed vitae nulla vel purus ultrices mollis. Maecenas id nulla id libero faucibus feugiat quis sit amet turpis. In commodo pellentesque risus at fringilla. Integer non interdum leo, non commodo ante. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut mi augue, dignissim at orci vel, egestas aliquam mi. Proin finibus aliquet tempor. Integer cursus, ex quis gravida rhoncus, nisi elit viverra ipsum, non efficitur est ex ac tortor. Praesent vitae odio massa.`} </Card> <br /> </div> ) } export default CardContent
import React from 'react' import Card from 'playbook-ui' import SectionSeparator from 'playbook-ui' const CardSeparator = (props) => { return ( <Card padding="none" > <Card.Body> {'Header'} </Card.Body> <SectionSeparator variant="card" /> <Card.Body> { 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec iaculis, risus a fringilla luctus, sapien eros sodales ex, quis molestie est nulla non turpis. Vestibulum aliquet at ipsum eget posuere. Morbi sed laoreet erat. Sed commodo posuere lectus, at porta nulla ornare a. Suspendisse quam est, sollicitudin ut enim sit amet, commodo placerat enim. Donec laoreet metus ac mauris pellentesque mattis. Pellentesque luctus vel mauris non aliquam. Mauris hendrerit mattis porttitor. Curabitur vehicula justo non ex consectetur commodo. Quisque posuere aliquet quam. Maecenas malesuada magna mauris, ac tempor metus euismod at. Cras ornare fermentum magna mollis efficitur. Sed vitae nulla vel purus ultrices mollis. Maecenas id nulla id libero faucibus feugiat quis sit amet turpis. In commodo pellentesque risus at fringilla. Integer non interdum leo, non commodo ante. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut mi augue, dignissim at orci vel, egestas aliquam mi. Proin finibus aliquet tempor. Integer cursus, ex quis gravida rhoncus, nisi elit viverra ipsum, non efficitur est ex ac tortor. Praesent vitae odio massa.' } </Card.Body> <SectionSeparator variant="card" /> <Card.Body> {'Footer'} </Card.Body> </Card> ) } export default CardSeparator
Remove card border only for dashboard cards.
border_radius_md
is the card kit default
import React from 'react' import Card from 'playbook-ui' const CardLight = (props) => { return ( <div> <Card borderRadius="rounded" > {'Rounded (1000px)'} </Card> <br /> <Card borderRadius="xl" > {'Extra large (16px)'} </Card> <br /> <Card borderRadius="lg" > {'Large (8px)'} </Card> <br /> <Card borderRadius="md" > {'Medium (6px)'} </Card> <br /> <Card borderRadius="sm" > {'Small (4px)'} </Card> <br /> <Card borderRadius="xs" > {'Extra small (4px)'} </Card> <br /> <Card borderRadius="none" > {'None'} </Card> </div> ) } export default CardLight