Display an avatar of a user or contact with initials or an image
Extra small size variant
Small size variant
Large size variant
Extra large variant
<div class="c-avatar [modifier class]">
<span class="c-avatar-initials">CD</span>
</div>
<div class="c-avatar [modifier class]">
<img src="https://cozy.io/fr/images/cozy-logo_white.png" class="c-avatar-image" alt="">
</div>
Display an chip that represents complex identity
<div>
<div class="c-chip">
<svg class="u-mr-half" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path d="M14,5c0,-1.656 -1.344,-3 -3,-3l-6,0c-1.656,0 -3,1.344 -3,3l0,6c0,1.656 1.344,3 3,3l6,0c1.656,0 3,-1.344 3,-3l0,-6Z"/>
</svg>
File
</div>
</div>
<div>
<div class="c-chip">
<div class="c-avatar c-avatar--small u-mr-half">
<img src="https://cozy.io/fr/images/cozy-logo_white.png" class="c-avatar-image" alt="">
</div>
Ada Lovelace
</div>
</div>
<div>
<div class="c-chip">
Developer
<span class="c-chip-separator"></span>
Ada Lovelace
</div>
</div>
<div>
<div class="c-chip c-chip--round">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path d="M14,5c0,-1.656 -1.344,-3 -3,-3l-6,0c-1.656,0 -3,1.344 -3,3l0,6c0,1.656 1.344,3 3,3l6,0c1.656,0 3,-1.344 3,-3l0,-6Z"/>
</svg>
</div>
</div>
Form elements
Label element coupled with any other form elements like inputs, textareas, select,etc
Error variant
<form>
<div>
<label class="c-label [modifier class]" for="">Hello, I'm a label</label>
</div>
</form>
Input element for text but also password, url, email
Error variant
Tiny size variant
Medium size variant
Large size variant (default)
Full width variant
<form>
<div class="u-mb-1">
<input type="text" class="c-input-text [modifier class]" placeholder="I'm an input[type=text]" value="" />
</div>
<div class="u-mb-1">
<input type="password" class="c-input-text [modifier class]" placeholder="I'm an input[type=password]" value="" />
</div>
<div class="u-mb-1">
<input type="url" class="c-input-text [modifier class]" placeholder="I'm an input[type=url]" value="" />
</div>
<div class="u-mb-1">
<input type="email" class="c-input-text [modifier class]" placeholder="I'm an input[type=email]" value="" />
</div>
</form>
Error variant
<form>
<h3>Standard checkbox</h3>
<div>
<label class="c-input-checkbox [modifier class]">
<input type="checkbox" />
<span>I'm a checkbox</span>
</label>
</div>
<h3>Mixed checkbox</h3>
<div>
<label class="c-input-checkbox [modifier class]" aria-checked="mixed">
<input type="checkbox" />
<span>I'm a checkbox</span>
</label>
</div>
</form>
Error variant
<form>
<div>
<label class="u-mb-half c-input-radio [modifier class]">
<input type="radio" name="radio"/>
<span>I'm a radio one</span>
</label>
<label class="u-mb-half c-input-radio [modifier class]">
<input type="radio" name="radio"/>
<span>I'm a radio two</span>
</label>
</div>
</form>
Error variant
Tiny size variant
Medium size variant
Full width variant
<form>
<div>
<textarea class="c-textarea [modifier class]" placeholder="Once upon a time…"></textarea>
</div>
</form>
Error variant
Tiny size variant
Medium size variant
Full width variant
<form>
<div>
<select class="c-select [modifier class]">
<option value="" disabled selected>Choose your option</option>
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
<option value="4">Option 4</option>
</select>
</div>
</form>
For a flexibility purpose, complex tables use <div>
element instead of <table>
but you still can use <table>
for simpler tables, see table-legacy below.
By default, only .c-table-cell--primary
has an ellipsis effect, but you can have it on any cell by applying the .c-table-ellipsis
class.
NB: You should decide by yourself the sizes of the columns. In those examples we use the style tag but you definitely should use CSS classes.
<div>
<h2>Table with div element</h2>
<div class="c-table">
<div class="c-table-head">
<div class="c-table-row-head">
<div class="c-table-header" style="width:50%">Header 1</div>
<div class="c-table-header" style="width:25%">Header 2</div>
<div class="c-table-header" style="width:25%">Header 3</div>
</div>
</div>
<div class="c-table-body">
<div class="c-table-row is-selected">
<div class="c-table-cell c-table-cell--primary" style="width:50%">Lorem ipsum dolor sit amet</div>
<div class="c-table-cell" style="width:25%">lorem</div>
<div class="c-table-cell c-table-ellipsis" style="width:25%">Lorem ipsum dolor sit amet, consectetur adipisicing elit.</div>
</div>
<div class="c-table-row">
<div class="c-table-cell c-table-cell--primary" style="width:50%">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusamus voluptate officia culpa debitis, vero quia quae vel laboriosam</div>
<div class="c-table-cell" style="width:25%">corporis</div>
<div class="c-table-cell" style="width:25%">placeat</div>
</div>
<div class="c-table-divider">Divider</div>
<div class="c-table-row">
<div class="c-table-cell c-table-cell--primary" style="width:50%">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusamus voluptate officia culpa debitis, vero quia quae vel laboriosam</div>
<div class="c-table-cell" style="width:25%">corporis</div>
<div class="c-table-cell" style="width:25%">placeat</div>
</div>
</div>
</div>
</div>
You also can use the <table>
if you want although it could be tricky for complex tables.
List of utility classes for table
.is-selected
on a <tr>
to highlight an entire line.c-table-divider
on a <tr>
to create a divider in your data table.c-table-cell--primary
on a <td>
to bring out a cell.c-table-ellipsis
on a <td>
to add an ellipsis effect without adding table-layout: fixed
property to the table. In order for this to work you MUST have 2 <div>
nested inside you <td>
. See exampleNB: Unlike the <div>
table, the cell with .c-table-cell--primary
does not have an ellipsis effect by default, if you want it must you add the .c-table-ellipsis
class and the needed DOM.
Header 1 | Header 2 | Header 3 |
---|---|---|
Lorem ipsum dolor sit amet | lorem | ipsum |
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusamus voluptate officia culpa debitis, vero quia quae vel laboriosam
|
corporis | placeat |
Divider | ||
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusamus voluptate officia culpa debitis, vero quia quae vel laboriosam
|
corporis | placeat |
<div>
<h2>Table with table element</h2>
<table class="c-table">
<thead>
<tr>
<th>Header 1</th>
<th>Header 2</th>
<th>Header 3</th>
</tr>
</thead>
<tbody>
<tr class="is-selected">
<td class="c-table-cell--primary">Lorem ipsum dolor sit amet</td>
<td>lorem</td>
<td>ipsum</td>
</tr>
<tr>
<td class="c-table-cell--primary c-table-ellipsis">
<div>
<div>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusamus voluptate officia culpa debitis, vero quia quae vel laboriosam</div>
</div>
</td>
<td>corporis</td>
<td>placeat</td>
</tr>
<tr class="c-table-divider">
<td colspan="3">Divider</td>
</tr>
<tr>
<td class="c-table-cell--primary c-table-ellipsis">
<div>
<div>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusamus voluptate officia culpa debitis, vero quia quae vel laboriosam</div>
</div>
</td>
<td>corporis</td>
<td>placeat</td>
</tr>
</tbody>
</table>
</div>
Buttons in different flavour
Basic alternative
Danger
Danger outlined
Highlighted button to catch the eye
Text only button
<div class="u-p-1">
<button class="c-btn [modifier class]"><span>Click me, I'm a button!</span></button>
<button class="c-btn c-btn--subtle [modifier class]"><span>Click me, I'm a button!</span></button>
</div>
Different sizes of buttons
Tiny button (for Alerts mostly)
Small button
Large button
<div class="u-p-1">
<button class="c-btn [modifier class]"><span>Click me</span></button>
<button class="c-btn c-btn--subtle [modifier class]"><span>Click me</span></button>
</div>
Different extensions of buttons
Narrow button (ignore button's min-width)
Full button
<div class="u-p-1">
<button class="c-btn [modifier class]"><span>Click</span></button>
<button class="c-btn c-btn--subtle [modifier class]"><span>Click</span></button>
</div>
Those buttons can inherit any flavour of buttons described above.
The SVG icon is filled with a color consistent with the theme of its button.
Basic alternative
Danger
Danger outlined
Highlighted button to catch the eye
<div class="u-p-1">
<button class="c-btn [modifier class]">
<span>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path d="M14,5c0,-1.656 -1.344,-3 -3,-3l-6,0c-1.656,0 -3,1.344 -3,3l0,6c0,1.656 1.344,3 3,3l6,0c1.656,0 3,-1.344 3,-3l0,-6Z"/>
</svg>
<span>Click me, I'm a button!</span>
</span>
</button>
<button class="c-btn c-btn--subtle [modifier class]">
<span>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path d="M14,5c0,-1.656 -1.344,-3 -3,-3l-6,0c-1.656,0 -3,1.344 -3,3l0,6c0,1.656 1.344,3 3,3l6,0c1.656,0 3,-1.344 3,-3l0,-6Z"/>
</svg>
<span>Click me, I'm a button!</span>
</span>
</button>
</div>
Buttons that look like links, with icons
Error button
Information button
Success button
<div class="u-p-1">
<button class="c-btn-alert [modifier class] u-m-1"><span>Click me, I'm a button!</span></button>
<a href="#" class="c-btn-alert [modifier class] u-m-1"><span>Click me, I'm a link!</span></a>
</div>
Special link that look like buttons ( only)
Button to download Cozy client app
Button to download Cozy client app on mobile
<div class="u-p-1" style="background-color: darkgrey; width: 50%;">
<a hre="#" class="[modifier class] u-mb-1"><span>Click me, I'm a link!</span></a>
</div>