|
| 1 | +import { Props } from '@storybook/addon-docs/blocks'; |
| 2 | +import { Card } from '../Card'; |
| 3 | + |
| 4 | +# CardLink |
| 5 | + |
| 6 | +> The cardlink component uses |
| 7 | +> [Carbon's Clickable Tile component](https://www.carbondesignsystem.com/components/tile/code#clickable-tile) |
| 8 | +> while presenting content in a concise and readable style. |
| 9 | +
|
| 10 | +## Getting started |
| 11 | + |
| 12 | +Here's a quick example to get you started. |
| 13 | + |
| 14 | +##### CSS |
| 15 | + |
| 16 | +```css |
| 17 | +// yourapplication.scss |
| 18 | +@import '@carbon/type/scss/font-face/mono'; |
| 19 | +@import '@carbon/type/scss/font-face/sans'; |
| 20 | +@include carbon--font-face-mono(); |
| 21 | +@include carbon--font-face-sans(); |
| 22 | +@import '@carbon/ibmdotcom-styles/scss/patterns/sub-patterns/card/index.scss'; |
| 23 | +``` |
| 24 | + |
| 25 | +> 💡 Only import fonts once per usage. Don't forget to import the Card styles |
| 26 | +> from |
| 27 | +> [@carbon/ibmdotcom-styles](https://github.com/carbon-design-system/ibm-dotcom-library/blob/master/packages/styles). |
| 28 | +
|
| 29 | +##### JS |
| 30 | + |
| 31 | +```javascript |
| 32 | +import React from 'react'; |
| 33 | +import ReactDOM from 'react-dom'; |
| 34 | +import { CardLink } from '@carbon/ibmdotcom-react'; |
| 35 | +import 'yourapplication.scss'; |
| 36 | + |
| 37 | +function App() { |
| 38 | + return ( |
| 39 | + <CardLink |
| 40 | + card={{ |
| 41 | + heading: 'Heading', |
| 42 | + copy: 'Lorem ipsum dolor sit amet', |
| 43 | + cta: { |
| 44 | + href: 'http://www.example.com', |
| 45 | + icon: { |
| 46 | + src: ArrowRight20, |
| 47 | + }, |
| 48 | + }, |
| 49 | + }} |
| 50 | + /> |
| 51 | + ); |
| 52 | +} |
| 53 | + |
| 54 | +ReactDOM.render(<App />, document.querySelector('#app')); |
| 55 | +``` |
| 56 | + |
| 57 | +Add the following line in your `.env` file at the root of your project. |
| 58 | +[See more details](https://github.com/carbon-design-system/ibm-dotcom-library/tree/master/packages/styles#usage). |
| 59 | + |
| 60 | +``` |
| 61 | + SASS_PATH=node_modules:src |
| 62 | +``` |
| 63 | + |
| 64 | +> 💡 Don't forget to import the card styles from |
| 65 | +> [@carbon/ibmdotcom-styles](https://github.com/carbon-design-system/ibm-dotcom-library/blob/master/packages/styles). |
| 66 | +
|
| 67 | +## Props |
| 68 | + |
| 69 | +<Props of={Card} /> |
| 70 | + |
| 71 | +## 🙌 Contributing |
| 72 | + |
| 73 | +We're always looking for contributors to help us fix bugs, build new features, |
| 74 | +or help us improve the project documentation. If you're interested, definitely |
| 75 | +check out our |
| 76 | +[Contributing Guide](https://github.com/carbon-design-system/ibm-dotcom-library/blob/master/.github/CONTRIBUTING.md)! |
| 77 | +👀 |
| 78 | + |
| 79 | +## 📝 License |
| 80 | + |
| 81 | +Licensed under the |
| 82 | +[Apache 2.0 License](https://github.com/carbon-design-system/ibm-dotcom-library/blob/master/LICENSE). |
0 commit comments