@@ -4,95 +4,115 @@ A card component that serves as a content container for images, text and links.
44
55Here is an example of a card
66
7- ``` html
8- <ul class =" list-unstyled layout" >
9- <EsCard class =" lg:col-2" >
10- This is a card
11- </EsCard >
12- </ul >
7+ ``` gjs live preview
8+ import EsCard from 'ember-styleguide/components/es-card';
9+
10+ <template>
11+ <ul class="list-unstyled layout">
12+ <EsCard class="lg:col-2">
13+ This is a card
14+ </EsCard>
15+ </ul>
16+ </template>
1317```
1418
1519You can also add an image to the card using the ` @image ` parameter:
1620
17- ``` html
18- <ul class =" list-unstyled layout" >
19- <EsCard @image ={{hash src =" /ember-logo.png" }} class =" lg:col-2" >
20- This is a card
21- </EsCard >
22- </ul >
21+ ``` gjs live preview
22+ import EsCard from 'ember-styleguide/components/es-card';
23+
24+ <template>
25+ <ul class="list-unstyled layout">
26+ <EsCard @image={{hash src="/ember-logo.png"}} class="lg:col-2">
27+ This is a card
28+ </EsCard>
29+ </ul>
30+ </template>
2331```
2432
2533By default images will be considered decorative and ignored by screen readers, but if you want to provide an alt text for the image you can provide it with the ` alt ` key in the ` @image ` hash:
2634
27- ``` html
28- <ul class =" list-unstyled layout" >
29- <EsCard @image ={{hash src =" /ember-logo.png" alt =" Ember Logo" }} class =" lg:col-2" >
30- This is a card
31- </EsCard >
32- </ul >
35+ ``` gjs live preview
36+ import EsCard from 'ember-styleguide/components/es-card';
37+
38+ <template>
39+ <ul class="list-unstyled layout">
40+ <EsCard @image={{hash src="/ember-logo.png" alt="Ember Logo"}} class="lg:col-2">
41+ This is a card
42+ </EsCard>
43+ </ul>
44+ </template>
3345```
3446
3547Here is a fuller example of a card that has more structure in the card body
3648
37- ``` html
38- <ul class =" list-unstyled layout" >
39- <EsCard @image ={{hash src =" /ember-logo.png" }} class =" lg:col-2" >
40- <h3 >Ember.js</h3 >
41- <p >A framework for ambitious web developers. Try it out!</p >
42- <div class =" flex-horizontal-between" >
43- <div ><a href =" #" >Visit Website</a ></div >
44- <div class =" text-sm text-muted" >COPYRIGHT 2019 TILDE INC.</div >
45- </div >
46- </EsCard >
47- </ul >
49+ ``` gjs live preview
50+ import EsCard from 'ember-styleguide/components/es-card';
51+
52+ <template>
53+ <ul class="list-unstyled layout">
54+ <EsCard @image={{hash src="/ember-logo.png"}} class="lg:col-2">
55+ <h3>Ember.js</h3>
56+ <p>A framework for ambitious web developers. Try it out!</p>
57+ <div class="flex-horizontal-between">
58+ <div><a href="#">Visit Website</a></div>
59+ <div class="text-sm text-muted">COPYRIGHT 2019 TILDE INC.</div>
60+ </div>
61+ </EsCard>
62+ </ul>
63+ </template>
4864```
4965
5066And here is a full card based page layout (which also makes use of the [ ESLinkCard] ( /components/link-card ) component) that might be useful when building sites using this component:
5167
52- ``` html
53- <ul class =" list-unstyled layout my-3" >
54- <EsLinkCard
55- class =" lg:col-3"
56- @href =" http://discuss.emberjs.com"
57- @title =" Discussion Forum"
58- @icon =" discuss-logo"
59- >
60- <p >Post and search longer-form questions in our public forum.</p >
61- </EsLinkCard >
62- <EsLinkCard
63- class =" lg:col-3"
64- @href =" https://discord.gg/emberjs"
65- @title =" Discord community chat"
66- @icon =" discord-logo"
67- >
68- <p >Join our real-time chat server to connect with other developers and get answers.</p >
69- </EsLinkCard >
70- </ul >
71-
72- <p >
73- Beyond our core online channels, you can dig deeper with these learning resources from the
74- community members
75- </p >
76-
77- <ul class =" list-unstyled layout my-3" >
78- <EsCard class =" lg:col-2 text-center" @icon =" mic-icon" >
79- <h3 >Podcasts</h3 >
80- <ul class =" list-unstyled" >
81- <li ><a href =" embermap somewhere" >Ember Weekly</a ></li >
82- <li ><a href =" embermap somewhere" >Ember Map Podcast</a ></li >
83- </ul >
84- </EsCard >
85- <EsCard class =" lg:col-2 text-center" @icon =" book-icon" >
86- <h3 >Books</h3 >
87- <ul class =" list-unstyled" >
88- <li ><a href =" embermap somewhere" >Rock and Roll with Ember.js</a ></li >
89- </ul >
90- </EsCard >
91- <EsCard class =" lg:col-2 text-center" @icon =" tv-icon" >
92- <h3 >Videos</h3 >
93- <ul class =" list-unstyled" >
94- <li ><a href =" embermap somewhere" >Ember Map</a ></li >
95- </ul >
96- </EsCard >
97- </ul >
68+ ``` gjs live preview
69+ import EsCard from 'ember-styleguide/components/es-card';
70+
71+ <template>
72+ <ul class="list-unstyled layout my-3">
73+ <EsLinkCard
74+ class="lg:col-3"
75+ @href="http://discuss.emberjs.com"
76+ @title="Discussion Forum"
77+ @icon="discuss-logo"
78+ >
79+ <p>Post and search longer-form questions in our public forum.</p>
80+ </EsLinkCard>
81+ <EsLinkCard
82+ class="lg:col-3"
83+ @href="https://discord.gg/emberjs"
84+ @title="Discord community chat"
85+ @icon="discord-logo"
86+ >
87+ <p>Join our real-time chat server to connect with other developers and get answers.</p>
88+ </EsLinkCard>
89+ </ul>
90+
91+ <p>
92+ Beyond our core online channels, you can dig deeper with these learning resources from the
93+ community members
94+ </p>
95+
96+ <ul class="list-unstyled layout my-3">
97+ <EsCard class="lg:col-2 text-center" @icon="mic-icon">
98+ <h3>Podcasts</h3>
99+ <ul class="list-unstyled">
100+ <li><a href="embermap somewhere">Ember Weekly</a></li>
101+ <li><a href="embermap somewhere">Ember Map Podcast</a></li>
102+ </ul>
103+ </EsCard>
104+ <EsCard class="lg:col-2 text-center" @icon="book-icon">
105+ <h3>Books</h3>
106+ <ul class="list-unstyled">
107+ <li><a href="embermap somewhere">Rock and Roll with Ember.js</a></li>
108+ </ul>
109+ </EsCard>
110+ <EsCard class="lg:col-2 text-center" @icon="tv-icon">
111+ <h3>Videos</h3>
112+ <ul class="list-unstyled">
113+ <li><a href="embermap somewhere">Ember Map</a></li>
114+ </ul>
115+ </EsCard>
116+ </ul>
117+ </template>
98118```
0 commit comments