BOSS UI Library

Version 2.0.19 - last update November 16, 2020

Basics

Colors

Hover to get more details. Click to copy hexadecimal code.

#bf0000
Main color
Links, buttons, clickable elements.
#900000
Main (hover)
Main hover.
#393c47
Important text
Titles, labels, column headers.
#555555
Regular text
Any normal text.
#999999
Light text
Secondary text, notes, additional details.

#ffffdb
Row active
A row or elements that is selected.
#ebf8ff
Row hover
A row that is under the mouse.
#f2f2f2
Soft highlighted
Light container (for example a form).

#00a0f0
Selected element
For example a tag that is currently applied.
#ff4040
Error & fail
Used for errors, fails, anything that isn't very good.
#f59600
Warning
Something that requires attention.
#03b452
Success & win
Positive feedback, completed actions.

Layout

Page width

By default, the page container has a width limited to 1000px.

Add the full-width class to #screen-content to allow the content to fill all available space.

Add the wider class to #screen-content to make the mage wider (1200px instead of 1000px).


							<div id="screen-content" class="full-width">
								...
							</div>
						

Basic page

sfe-page

Container for standard pages.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Page form - horizontal

sfe-page page-form

You can add a section form above the page content with page-form. This is recommended for forms.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Page form - vertical

sfe-page page-form

Replace .page-content by .page-content-two-columns to have a vertical form.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Dynamic page tabs

sfe-page with-tabs

Dynamic tabs allows to switch tabs without reloading the page. This is best for the user.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Static page tabs

page-tabs

Sometimes, each tab must be a separate page for technical reason. In this case, the tabs must be set as links.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Disabled tab

Add the disabled attribute to disable a tab. Disabled tab can not be clicked and display as muted.

Note: it's a good practice to let the user know why the tab is disabled and what action they can take in order to use the button. This can typically be done with a tooltip applied on the tab.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Widgets

sfe-widget

Most content should be contained in widgets. There can either be one large widget, or several smaller ones.

Standard widget

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Widget tabs

sfe-widget with-tabs

Follow the structure below for widgets with tabs. The tabs will autmatically show the tab-content with the same index (for example, third tab will be linked to third tab-content).

Make sure the default tab and its content have the active class.

Tab 1
Tab 2
Lorem ipsum dolor sit amet.
One
Two
Three

Record card

sfe-record-card

A component halfway between a widget and a table. Useful when there are only a few records to display.

This component allows a higher information density than typical tables.

The component has a header, a preview and a content part. By default, the header and preview are displayed. A click on the header will toggle the content part.

The line on the left is supposed to reflect the status of the record. The following classes can be applied: status-success status-fail status-info status-warning status-new

Item ID 123456-78
ready

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Columns

sfe-columns

Simple layout component to create columns.

To fix the width of columns, use the classes two-columns, three-columns, four-columns.

By default, there is no line. Add the with-line class to separate the columns by a thin line.

With two columns, each column is 50% wide by default. Add the ratio-2-1 or ratio-3-1 class to the sfe-columns element to make the first column 2/3 or 3/4 of the width.

The gap between columns is 32px by default. Add the tighter class to make the columns tighter (16px gap). Add the no-spacing class to completely remove the gap between columns.

Column title

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Spread content

sfe-spread-content

Simple layout component to divide and spread the content horizontally.

By default, the elements are aligned to the top. Add the vertically-centered class if you want elements to be centered vertically.

asdf
asdf

asdf
asdf
asdf

Align center or right

sfe-center sfe-right

Simple layout component to align the content center or right.


Banana

Margins

sfe-margin-vertical

To space elements vertically. Adds a small margin above and below the content.

Top and bottom margin

Use the sfe-margin-top and sfe-margin-bottom to control the margin at the top and bottom.

Horizontal margin

Likewise, the horizontal margin can be controled by sfe-margin-horizontal, sfe-margin-left and sfe-margin-right.

Break long words

sfe-break-words

Prevents long long words from overflowing their container.

Warning: this might break in the middle of a word!

my_extra_long_email_address@gmail.com

my_extra_long_email_address@gmail.com

Autocut texts

sfe-autocut

Apply this class to a container to show only one line of the text, and display an ellipsis (...) at the end if it's longer. You can use this anywhere, including in tables.

This component applies no design by itself, it only cuts the text.

Add the sfe-tooltip class if you'd like to display the full content in a tooltip on mouse hover. The tooltip will only show if the content is cut.

Note: the text must be directly inside the element with sfe-autocut. Don't wrap it into any additional tag inside as it will cause issue (missing ellipsis for example).

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
This one will display the full content in a tooltip. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Content switch

sfe-content-switch

This will toggle the display of elements based on the value of a field. It can work with any field, but is typically used with dropdowns or checkboxes.

Put the mapping of elements to display in the data-content-switch attribute using the following syntax:

  • The default format is value:selector. When the field's value equals value, the elements corresponding to selector will be displayed.
  • For checkboxes, the two possible values are on and off.
  • CSS selectors are used for the selector. For example value:#element-id to affect a specific element, or value:.element-class to affect all elements with a class.
  • You can use several selectors by separating them with commas, for example value:#element-a,#element-b.
  • You can combine several values by separating them with a semicolon, for example value-1:#element-a;value-2:#element-b. You can however not have the same values multiple times.

Yes, it's true. They're very cute!


This is the item one. It's tiny!

Item two. Wow, this one is much bigger.

Components

Buttons

sfe-button

Buttons should be used to call action (submit something, save something, create something, etc.). They can occasionall also be used to link to another page.

Standard buttons

Add the sfe-button class to a button, link or form control.

If the button links to a page, use a <a> anchor tag. If the button calls a Javascript function, use a <button> tag. If the button submits a form, use a <input type="submit"> form control.

Note: If you include a button in a form, by default it will submit the form (standard HTML behaviour). Addtype="button" to prevent this default behaviour.

Link

Primary and secondary buttons

Use the primary class to mark the button leading to the primary action. There should ideally not be more than one primary button visible on any given screen.

Button size

The button size can be controled with the small and big classes.

Note: buttons placed in a form with large controls will automatically display as big.

Compact button

Primary and secondary buttons have a minimum width by default. Add the compact class to get rid of the minimum width.

Disabled button

Add the disabled attribute to disable the button. Disabled buttons can not be clicked and display as muted.

Note: it's a good practice to let the user know why the button is disabled and what action they can take in order to use the button. This can typically be done with a tooltip applied on the button.

Restricted button

Add the restriced class to disable the button. Disabled buttons display as muted with an icon.

Note: it's a good practice to let the user know why the button is restricted. This can typically be done with a tooltip applied on the button.

Note: the restricted class doesn't prevent the user from clicking on it, so make sure that no function is attached to it.

Button states

Add the loading class to a button to make it look like it's loading. This prevents the user to click the button again.

Make sure to catch the clicks on the button and discard them.

In the exemple below, the loading class is added on click, and removed after 2 seconds.

Click this button to see the loading animation

Buttons with icons

sfe-button with-icon

Standard buttons

Add the with-icon class and an icon name to add an icon to a button.

This works on any button and the icon color will adapt to the button color.

Note: Unfortunately icons can not be added on <input> elements.

Icon buttons

Add the no-text class to create buttons with no text. Make sure to use icons that are self-explanatory.

Note: text should still be added in the button for accessibility purpose (screen readers, blind people, etc.).

Ghost buttons / links

Creating links works the same way as buttons.

Icons

sfe-icon

Small component to display an icon.

The icon takes the color and size of the text around.

icon-paw icon-edit icon-cross icon-save
icon-left icon-right icon-doc icon-download
icon-info icon-share icon-search icon-gift
icon-external icon-calendar icon-plus icon-grip
icon-check icon-ellipsis icon-refresh icon-warning
icon-tool icon-delete icon-lock icon-refund
icon-replace

Need to add an icon? Instructions about adding new icons are placed in the CSS file (components.css around line 250 at time of writing).

Icons follow the font size and color of the text around them.
Note
Title
Info

Mall icons

sfe-mall-icon

Simple icons for each mall. Use the class sfe-mall-icon followed by the class name of the mall.

Rakuten
Amazon
Yahoo
Wowma
au payマーケット

Tags

sfe-tag

Standard tag

Add the sfe-tag class to a div or anchor to display a tag.

Static

Clickable

Cut caption

Add a span inside the tag to automatically cut long captions. This is necessary on some layouts where space is limited. It'll cut the tag after 200px, or 20 Japanese characters.

A very long tag caption, too long for a tag caption to fit in the tag

A very long tag caption, too long for a tag caption to fit in the tag

Count badge

Add a span with a badge class at the end of the tag to display the count of elements tagged.

Tomato 17

System tags

The following classes will add a colored bullet to the tag: new warning fail success default.

New
Warning
Fail
Success
Inactive

User tags style

Add classes tag-style-a to tag-style-f for the user tags predefined colors.

Default style
Style A
Style B
Style C
Style D
Style E
Style F
Disco style

Blocker tag

Add the blocker class to show a tag is blocking the current record.

Blocker

Badges

sfe-badge

A simple component to display a highlighted piece of information

new

Status bullets

sfe-status

Simple component to display a status with a colored bullet. The classes for orders correspond to the BOSS status values.

Bullet Class Meaning
new New, will change to another status automatically
ok All good mate
warning Warning, minor issue, unusual situation
not-ok Failure, major issue, blocking
active Currently processing something
done Finished, final status and won't change
inactive Inactive, not applicable
caution Not as serious as warning
deleted The item has been deleted

ok

not-ok

inactive


The bullet adapts to the font size:
Smaller
Larger

Tooltips

sfe-tooltips

Use tooltips to provide additional contextual details that will be displayed on rollover. You can add tooltips on most elements (tags, buttons, links, etc.).

The library will look for the content of the tooltip the following ways:

  • Title attribute: the title attribute will be used as tooltip content.
  • Element after the tooltip trigger: the content of a div with the class sfe-tooltip-content placed immediately after the element. This is useful to place HTML into the tooltip.
  • Content of the tooltip trigger: as last resort, the HTML content of the element itself will be used. This is useful to display long texts that have been cut.

If needed, you can control the width of the tooltip with the attribute data-tooltip-width.

You can change the visual style of the tooltip by adding classes dark-tooltip-style or alt-tooltip-style.

If you need to open a tooltip below its target, add the tooltip-below class.

You can also make the tooltip stay visible when the user move the mouse to it, if necessary. Avoid using this feature as it can be quite irritating.

Basic example with text in attribute

Hover me

Tooltips on other controls

The tooltip can be added on any HTML element. In this example, it's applied on a tag, a button and an ico.

Address error

Tooltip position

Add the tooltip-below class to open the tooltip below instead of above its trigger element.

Alternative styles

The style can be changed by adding the dark-tooltip-style or alt-tooltip-style classes.

Complex content

If the content contains HTML, it can't be put in the title attribute. In this case, it can be put inside a div with the sfe-tooltip-content class directly after the tag element.

7 tags
Eggplant
Carrot
Potato
Cucumber
Tomato

Interactive content

If the content needs to be interacted with, for example containing a link, add the interactive class. This will make the tooltip stay open when the user leaves the tooltip trigger, in order to let them interact with its content.

You can select this text and even click the links.

Tooltip width

The width of the tooltip can be controled by the data-tooltip-width attribute. The width must be specified in pixel.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Show full content

If the content of the tooltip isn't specified, the content of the trigger will be used instead and show if the content is wider than its container. This typically happens when using sfe-autocut. This is useful on cases the content is cut, as the full content will be displayed on hover.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Notifications

sfe-notification

Used to show a notification / message to the user.

There are 4 classes to give an appropriate look to the message: success fail info warning.

Buttons can be added if necessary in an additional div with the class actions.

Note: Make sure the message is short, clear and helpful. Avoid technical jargon. Help the user understand what went wrong and how to fix it.

Note: Place the notifications close to the control that triggered them (ideally right under the submit button).

The order 982729 has been successfully updated.
Unfortunately, everything failed.
There is something you need to know. Please read the documentation to learn more.
This order has unsaved changes. Leave this page anyway?

Ajax notifications

sfeNotifications.add(class, message)

You can call a JS function to display ajax notifications.

Those notifications will be displayed at the bottom right corner of the screen.

A class for the notification must be passed as the first argument (success fail info warning). The second argument is the text for the message. The text can contain HTML. Error messages will stay visible, while other classes will disappear after 5 seconds.

Notification texts

sfe-text-danger sfe-text-warning sfe-text-success sfe-text-info

Use those classes to change the color / weight of texts.

Something went wrong.
This requires your attention.
Dude, this stuff is good.
Some neutral, informative text.

Wizard

sfe-wizard-steps

Used to show progress in wizards. The state of each step is controlled by classes (completed, current and pending). Completed steps should be a link.

Should be used on gray background, outside of a page container.

Step 1
自動マッピング仮登録
Step 2
自動マッピング
仮登録一覧
Step 3
商品マッピング
(CSVアップロード)

Progress bar

sfe-progress

Use this to guide the user through a procedure.

Should be used on white background, inside of a page container.

Current step
Pending step
Pending step

Empty state

sfe-empty-state

Large placeholder to use as empty states. Keep the text helpful for the user and lead them to the next step.

No content yet

Once you created some content, it will be displayed here.

Create content

Placeholder

sfe-placeholder

Small placeholder to use in empty states and empty lists. Is smaller than sfe-empty-state and should typically be used for subsections.

Keep the text simple and straightforward, it's there to help the user.

There's no content here.

Pagination

sfe-pagination

If there are less than 10 pages, display all the pages. If there are more, display the first, last, and current page with two adjacent pages on each side.

201-225/417 件表示 « 前頁 1 ... 7 8 9 10 11 ... 17 次頁 »

Action bar

sfe-action-bar

The action bar stays sticky at the bottom its container while scrolling.

It's useful for tables or particularly large forms.

If needed, the content of the action bar can be organized with layout components such as sfe-spread-content. It's recommended to keep it as simple as possible.

Scroll down to see action bar being sticky

Loading placeholder

sfe-loading

Use this component as a placeholder when some content is loading. The animation is display at the center horizontally and has margins vertically.

The size can be changed with the big or small classes.



Announcement bar

sfe-announcement-bar

Use this for major announcements.

It can be used anywhere, but had been designed to be at the top of the bage, right below <body>.

By default, the bar can't be dismissed. Add the dismissable class to make the bar dismissable.

The world will end if you don't take action now. Action

Slider

sfe-slider

An image slider. Also known as a carousel.

The slides can be div elements or links.

Note: the slider supports slide gesture. If you wish to use slide gestures, make sure the jQuery touchSwipe library is loaded.

Some exciting feature

It's really fantastic and you should try it right now

Some exciting feature

It's really fantastic and you should try it right now

Some exciting feature

It's really fantastic and you should try it right now

Dropdown panel

sfe-dropdown-panel

A dropdown panels that opens above the content to show information or controls.

More
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Show more

sfe-show-more

A button that shows or hide a block. The block can be anywhere in the page, but should ideally be placed below the trigger button.

Set the target in the data-target attribute. This can either be an ID or a jQuery selector (for example .something, input[type='text']).

An alternative text can be put in the data-alt-text attribute, that will be displayed when the target is open. If this attribute is missing, the text will not change.

Note: Sometimes the animation can cause issues (for example in modals). The animation can be disabled by adding the no-animation class.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Dropdown

sfe-dropdown

A custom dropdown component that can be used for advanced forms.

Note: Add the disabled class to make the dropdown disabled. The dropdown will appear disabled and the user will not be able to select any option.

Standard example

This is the most basic sample of sfe-dropdown.

Select
Tomato
Olive
Basil

Select tag

The component can me modified with the following classes:

  • searchable: allow the user to type to filter options.
  • multi-select: allow the user to select more than one option.
  • always-open: the dropdown is always open, rather than dropping down on focus.
  • options-inline: the options are displayed inline, rather than one on each row.

The maximum number of items that can be selected the user can be set with the attribute data-max-count. If the user tries to select more than the mount specified, a red message will appear under the field. By default, if the attribute is not present, there are not limits.

タグを選択
Tomato
Olive
Garlic
Cheese
Strawberry
後払い未入金
与信取消中
Tag C
信じられない
送付先氏名
Amazon
Yahoo
Rakuten
トマト
迅速な配達
Olive
Potato
北海道
沖縄県
An extremely long tag that might break things
Artichoke
Cabbage
Broccoli
クレジットカード
Pepper
Ginger
Carrot
Radish
Cucumber
Pumpkin
Onion
Garlic

Get value

The value of a dropdown can be recovered in javascript with the getSelection() method. It'll return an array with all the values selected.

The sample below will get the values of the tag selector used in the previous example.

Options selected by default

If some options have to be selected at the initial pageload, add the selected class on the option as below.

タグを選択
Tomato
Olive
Garlic
Cheese

Clone a dropdown

Since the dropdown is a complex element, it can't simply be cloned after being initialized.

If you wish to have a clonable dropdown, you must first make a template by adding the template-element class to it. This element will not be initialized on the page load, and will be unusable. It's a good idea to keep it hidden from the user.

This element can then be cloned using the .cloneInto(target) method. Pass the target dom node as parameter, and the cloned element will be appended into this node.

Source element

タグを選択
Tomato
Olive
Garlic
Cheese

Target element

Form components

Text field

sfe-field-text

Add the sfe-field-text class to a text or email field to give it the standard appearance.

Dropdown

sfe-field-dropdown

Add the sfe-field-dropdown class to a select field to give it the right appearance.

Note: If no value is selected, the default placeholder value must have the disabled and selected attributes, and should be affixed with dashes to differentiate it from actual values.

Textarea

sfe-field-textarea

Standard textarea. The textarea size adapts automatically to its content.

Limit height

To limit the height of a textarea, add the limit-height class. This will limit the height to two and a half lines. The height will automatically adapt to show the whole content when the user focuses on the field.

Minimum height

To give a minimum height to the textarea, add the min-height class. This will make the box at least 5 rows high even if the content is shorter.

Prevent linebreaks

To prevent linebreaks in a textarea, add the no-linebreak class. The user will not be able to input any linebreaks.

Prevent linebreaks

To prevent linebreaks in a textarea, add the no-linebreak class. The user will not be able to input any linebreaks.

Checkbox

sfe-field-checkbox

To get the proper styling, checkboxes need additional markup (since standard checkboxes can not be styled in CSS). This markup is added automatically in javascript after the page load.

In some cases, the full dom might have to be present. Both options are shown in the example below.

Add the larger class to have a larger checkbox.

Note: The additional markup takes a fraction of a second to be added. It's recommended to use the full markup for prominent checkboxes, otherwise the unstyled box will briefly be visible.

Note: If included in a form with the .sfe-form.larger class, the checkboxes are automatically made larger, unless they're within a subfield.

Note: By default, there is a 20px space on the right of the checkbox, before the next element. This space can be removed by adding the no-spacing class.




On/off switch

sfe-field-switch

A stylized switch control based on a modified checkbox.

Note: The additional markup takes a fraction of a second to be added. It's recommended to use the full markup for prominent switches, otherwise the unstyled checkbox will briefly be visible.

Note: The text in the component can not be changed.



Radio buttons

sfe-field-radio

Radio buttons are managed similarly to checkboxes. The UI library will automatically add the necessary markup.

Range

sfe-field-range

Two fields for a range. The fields are automatically separated by a en dash to signify the range, following the APA style notation.

The fields will fill all the available width of the conainer.

Tokens

sfe-field-tokenize

A field containing tokens. Users can type and add new tokens by typing comma or enter.

The tokens are stored as text in the original field, separated by commas.

Limit count

The amount of tokens can can be limited by the data-max-count attribute. This also limits the amount of tokens that can be added programmatically.

In the example below, the user can only add 3 tokens.

Uneditable

The not-editable class makes the field not editable by the user, although they can still be deleted. Tokens are typically added by javascript when using non editable token fields.

Note: to completely disable a token field, simply use the disable attribute. This will prevent the user from interactive in any way with it.

Javascript control

Tokens can be added by javascript, using the addToken method, as in the example below.


Date picker

sfe-field-date

Field for dates. An icon is added to the field and a datepicker drops down when the field is focused.

Note: As this also apply the .sfe-field-text class to have the correct styling.

Note: For legacy reasons, the date field is automatically validated by the UI library. If you'd rather perform the validation manually, add the no-validation class to the date field.

Dependencies: the date picker requires the datepicker.js library to be loaded. If the library is missing, an error message will be displayed under the field.

Date range picker

sfe-field-daterange

Use this component for date range. A double date picker drops down when one of the fields has focus

Dependencies: the date range picker requires the datepicker.js library to be loaded. If the library is missing, an error message will be displayed under the fields.

Note: For legacy reasons, the daterange field is automatically validated by the UI library. If you'd rather perform the validation manually, add the no-validation class to the sfe-field-daterange element.

Number field

monetary-field

There are special classes for monetary, percentage and item count fields.

Enclose the field in a div with the corresponding class to add the character.

It's recommended to set the field to an appropriate size.





Field with button

sfe-field-with-button

Put a button attached to a field.

If needed, add the wider class to make the button wider to accomodate longer words.

Track unsaved changes

sfe-unsaved-changes

Add the sfe-unsaved-changes class to an element to track the changes done to the fields inside. If any change was made, the user will receive a warning when they're trying to leave the page.

This also tracks the changes made in tables (drag and drop, add or remove rows).

If an action bar is present in the container, it will display a small notice next to the primary button.

Note: it is recommended to add the sfe-unsaved-changes on the sfe-page element.

Note: to exclude a field from the change detection, add the ignore-changes on the field. With this class, changes to this field will not trigger the component.

Note: add the discard-unsaved-changes on a button to make it discard the unsaved changes on click.

Change the value of a field and try refreshing the page.

Changes can be triggered or canceled by javascript by calling the methods hasChanged() and discardChanges().

See the example below.



Forms

Standard form

sfe-form sfe-field

Use the following structure for standard forms.

Larger form

sfe-form.larger

Add the larger class to a form to make it larger.

It will make the fields larger. This is appropriate for forms that have few controls.

Compact form

sfe-form.compact

Add the compact class to a form to make it compact.

It will make the labels smaller, and reduce the space between the fields. This is appropriate for forms that have to fit into small spaces, or forms that have many controls.

Form columns

sfe-field.half sfe-field.third

Add the half, third or quarter class to a field to make it fill only a fraction of the space available.

This allows to create columns to organize your fields and build more complex forms.

Note: sfe-columns can not be used inside sfe-form.

Form title

form-title

A title can be added to forms with the form-title class. This is useful when trying to group many fields into several subsections. Those titles work best on compact forms, since the field labels are smaller.

Customer address

Form meta

form-meta

An additional element can be added at the top right of form, using a form-meta element. This should only be used together with a form-title.

This is useful to provide an additional link or control to the form.

Customer
Customer ID 2489457

Field meta

sub-field sfe-field-note

Additional elements can be added for fields.

Anything in a sub-field element will be displayed at the top right. This element should always be placed before the sfe-field-label.

Small notes can be added under the field using the sfe-field-note class.

Small notes can be displayed under the field.

Check all checkboxes

sfe-check-all

Add a control with .sfe-check-all class to invert the status of all the checkboxes that are in the same .field container.

A good place to add the control is in the .sub-field, next to the label.

Static values

sfe-text-value

Sometimes a value has to be displayed as text rather than as a field within a form.

Replace the field by an element with the sfe-text-value class to enclose the text value. This will insure that the form stays aligned if you have several rows and columns.

Note: Disabled fields are also a good choice for uneditable values.

Static value

Field error

sfe-field-error

Use this class to highlight errors in a form. The class must be applied to an element wrapping the field.

An explanation about the error should be provided in a <div class="sfe-note error"> below the field.

This value can't be empty.

Values list

sfe-values-list

This is an alternative to sfe-form. It's useful to display vertical lists with small values.

It can be used to list both static values or form controls.

Fixed fee
350 円
Billing total
14,850 円

If the list must fit in a narrow column, add the vertical class to make the list vertical.

Color
Red
Size
Large

Basic tables

Basic table

sfe-table

The basic HTML tables can be used when advanced functionalities are not required.

Make sure <thead> and <tbody> are present in the HTML.

Add the class striped to add stripes to the table.

Note: use tables only to display table data. Do not use tables to create layout. CSS should be used to create layout. Ask for help if you're not sure.

Note: do not use sfe-table with datatables. See the datatables section for more details.

Note: You can control the alignement of the content by adding the center or right classes on the cell.

ID Name Favorite animal
26326 Harold Johnson Alpaca
83927 Caroline Müller Turtle
25412 Gilbert Dumont Pigeon

Highlighted rows

highlight

Individual rows can be highlighted with a class. highlight will highlight in blue, highlight-red will highlight in red, highlight-green will highlight in green.

Note: when using highlight-red to show errors, don't forget to wrap the field with error in a sfe-field-error to add the red halo.

ID Name Favorite animal
26326 Alpaca
14847
This name could not be matched.
Penguin
25412 Pigeon
83927 Turtle

Selectable table

sfe-table selectable

Add the selectable class to the table to make it selectable.

Add a checkbox for each row. You can either use simple native checkboxes, or custom sfe-field-checkbox checkboxes. The functions for checkboxes are attached automatically to the table.

ID Name Favorite animal
26326 Harold McFlurpy Alpaca
83927 Caroline Müller Turtle
25412 Gilbert Dumont Pigeon

Drag and drop table

sfe-table table-drag-and-drop

Add the table-drag-and-drop class to the table to allow the user to reorganize its rows by drag&drop.

A new column containing the handles will be added automatically.

Note: this works for both sfe-table and sfe-flex-table. See an example for flex tables.

ID Name
26326 Harold McFlurpy
83927 Caroline Müller
25412 Gilbert Dumont

Add and remove rows

sfe-table table-add-row

Add the table-add-row class to the table to allow the user to add rows.

Add a button with the table-delete-row-button class to a row to allow the user to delete the row.

You must set a template row for new lines with the class new-row-template.

A button with the class table-add-row-button will be used to add new rows. It must be placed in the same container as the table.

By default, an infinite amount of rows can be added. The amount of rows can be limited by the data-max-rows attribute.

Since fields usually need unique names / ID, a $counter$ placeholder can be used, which will be replaced by the line number. Refer to the example below to see it in action, each field has a unique name

Note: this works for both sfe-table and sfe-flex-table. See an example for flex tables.

ID Name
1
2
$counter$

Sortable columns

sortable

Add the sortable class to a table to make the table sortable.

The icons will be automatically added.

Add the non-sortable class to a cell header if the column should not be sortable.

Note: this works for both sfe-table and sfe-flex-table. See an example for flex tables.

Unique ID Name Favorite animal
1004 Harold Johnson Alpaca
1003 Caroline Müller Turtle
82 Gilbert Dumont Pigeon

Column filter

filterable

Add the filterable class to a column header to make that column filterable.

A text field will be added to the column header. If the user types something in this field, the table will be filtered to show only rows that contains this value in said column.

Note: this works for both sfe-table and sfe-flex-table. See an example for flex tables.

Unique ID Name Favorite animal
1004Harold JohnsonAlpaca
1003Caroline MüllerTurtle
1007Gilbert DumontPigeon
1245Brian ChaseHamster
1018Mark GuntherSloth
1043Robert PetersonElephant

Automatic pagination

paged

Add the paged class to a table to add an automatic pagination.

The number of items per page is 50 by default. If necessary, it can be controled with the data-items-per-page attribute to change it.

Additional controls for the table should be displayed in a container with the sfe-buttons-next-to-pagination class above the table. This container will always be displayed at the right position, regardless if a pagination is present or not.

Note: When using with on striped table, it is recommended to avoid odd numbers for the items per page, as it causes display issues (first row on even pages will be same color as header).

Note: The number of results will always be shown, but the pagination will not be shown if there's only one page. To force the pagination to be shown even when there is only one page, add a data-force-pagination="true" attribute to the table.

Note: this works for both sfe-table and sfe-flex-table. See an example for flex tables.

Name
Juliette Danielle
Tommy Wiseau
Harold McFlurpy
Francesca Monterosa
Gilbert Dumont
Roger Taylor
Antonio Spaghetti
Hubert de Montmirail
Maria Bueno
Mary-Ann Eisel
Peter Curtis
Grigori Yefimovich Rasputin
Robert Lutz
Heinz Günthardt
Alexander Volkov
Philippe Coutinho Correia

Add a callback on page change

A callback function can be attached to the table with the method table.setPaginationCallback(function). This function will be fired each time the user changes the pages.

Name
Juliette Danielle
Tommy Wiseau
Harold McFlurpy
Francesca Monterosa
Gilbert Dumont
Roger Taylor
Antonio Spaghetti
Hubert de Montmirail
Maria Bueno
Mary-Ann Eisel
Peter Curtis

Datatables

If creating tables with the datatables library, do not use any of the sfe classes.

Instead, simply include datatables.css to your page. This will apply the styles to give the right aspect to the tables.

Flex tables

Flex table

sfe-flex-table

Flex tables give more functionalities and flexibility for complex sets of data. They are built with the CSS flexbox model, rather than traditional HTML tables.

Those are the functionalities that flex tables have compared to basic tables:

  • Sticky action bar
  • Sticky header
  • Inline details
  • Inline actions
  • Ajax loading state
  • Set of javascript methods to interact with the table

The column width can be controled with the classes below. The classes must be applied to each cell. It's recommended to have at least one cell-size-l column per table, since only those can handle width variations.

  • cell-size-xs: 40px
  • cell-size-s: 80px
  • cell-size-s: 160px
  • cell-size-l: 320px - the column width will adapt depending on the screen size
  • You can also set the width of a specific column using the page's custom CSS.

Note: The alignement of the content can be controled by adding the center or right classes on the cell.

ID
Name
Favorite quote
26326
Harold McFlurpy
“Twenty years from now you will be more disappointed by the things that you didn’t do than by the ones you did do.”
83927
Caroline Müller
“When one door of happiness closes, another opens; but often we look so long at the closed door that we do not see the one which has been opened for us.”
25412
Gilbert Dumont
“Our greatest fear should not be of failure… but of succeeding at things in life that don’t really matter.”

Javascript methods

The flex table HTML element can be interacted with using a number of javascript methods:

  • reset()
    Remove all results and reset the counters
  • setLoading(state)
    Set / unset loading state.
    @param {Boolean} state - To set the loading state to true or false.
  • injectNewResults(html, total_count)
    Inject new results into the list
    @param {String} html - The HTML of the rows to add
    @param {Integer} total_count - The total number of results in the set.
  • updateNumbers()
    Update the numbers displayed in the table
  • appendResults()
    Append rows to the table, used to display results.
    @param {String} html - The HTML of the rows to add.
  • getSelection()
    Get the list of selected rows
  • getSelectionIDs()
    Get an array with the IDS of selected rows
  • addRow()
    Add a row at the end of the table.
  • updateAddRowButton()
    Enable / disable the "Add Row" button depending on the maximum amount of rows that can be added to the table.
  • addDragAndDrop()
    Modify the table to make the rows draggable

Allow multiline content

sfe-flex-table allow-multiline

By default, the content of a row is limited to one line, and the rest is cut with ellipsis.

Add the allow-multiline class on a table to allow the content to go on several lines. The class can also be added on an individual cell if needed.

ID
Name
Favorite quote
26326
Harold McFlurpy
“Twenty years from now you will be more disappointed by the things that you didn’t do than by the ones you did do.”
83927
Caroline Müller
“When one door of happiness closes, another opens; but often we look so long at the closed door that we do not see the one which has been opened for us.”

Selectable and action bar

sfe-flex-table selectable

Here is an example of a selectable flex-table with an action bar.

The action bar contains the batch actions to apply the selection. It is only displayed when at least one row of the table is selected.

The content of the action bar can be styled using the page's custom CSS.

The total of items in the table / in the set / currently selected is automatically updated when put in elements with the following classes:

  • Number of items selected: selected-result-count
  • Number of items currently displayed: displayed-result-count
  • Total number of items in set: total-result-count

Check the HTML comments in the example below for more information.

ID
Name
Favorite quote
26326
Harold McFlurpy
“Twenty years from now you will be more disappointed by the things that you didn’t do than by the ones you did do.”
83927
Caroline Müller
“When one door of happiness closes, another opens; but often we look so long at the closed door that we do not see the one which has been opened for us.”
25412
Gilbert Dumont
“Our greatest fear should not be of failure… but of succeeding at things in life that don’t really matter.”
0/0 orders selected

Drag and drop

sfe-flex-table table-drag-and-drop

This is an example for drag and drop on a flex table. See the table drag and drop documentation.

Note: if several rows have to be moved together with drag and drop (for example because of inline details), put the rows into a .row-group element.

ID
Name
Favorite quote
26326
Harold McFlurpy
“Twenty years from now you will be more disappointed by the things that you didn’t do than by the ones you did do.”
83927
Caroline Müller
“When one door of happiness closes, another opens; but often we look so long at the closed door that we do not see the one which has been opened for us.”
25412
Gilbert Dumont
“Our greatest fear should not be of failure… but of succeeding at things in life that don’t really matter.”

Add and remove rows

sfe-flex-table table-add-row

This is an example for an editable flex table. See the editable table documentation.

ID
Name
1
2
$counter$

Sortable columns

sfe-flex-table sortable

This is an example for a sortable flex table. See the sortable table documentation.

ID
Name
Favorite quote
26326
Harold McFlurpy
“Twenty years from now you will be more disappointed by the things that you didn’t do than by the ones you did do.”
83927
Caroline Müller
“When one door of happiness closes, another opens; but often we look so long at the closed door that we do not see the one which has been opened for us.”
25412
Gilbert Dumont
“Our greatest fear should not be of failure… but of succeeding at things in life that don’t really matter.”

Column filter

filterable

This is an example for a sortable flex table. See the column filter documentation.

ID
Name
Favorite animal
26326
Harold Johnson
Pigeon
83927
Caroline Müller
Elephant
25412
Gilbert Dumont
Hamster

Inline details

Hidden rows with additional details can be added. To toggle the row's display, use an element with the .inline-details-toggle class in the parent row.

The .inline-details-toggle can be put on a link, a button, or a .sfe-toggle-more component, as in the example below.

Note: when having hidden details rows in a striped table, use the .striped-double instead .striped class ( one out of every 4 rows must be highlighted instead of every other row).

Note: when using with a sortable table or pagination, always use a row-group element around the row pairs, otherwise the sort function will fail and rows might not be paired together anymore.

There are three ways to link a inline-details-toggle with a detail row, as detailed below.

Link with row-group

Put the row and its inline-details together in a row-group parent element.

Name
Details
Harold McFlurpy
Show quote
“Twenty years from now you will be more disappointed by the things that you didn’t do than by the ones you did do.”

Link explicitly with ID

Add a data-toggle-target attribute containing the ID of the target row on the inline-details-toggle element.

Note: using this method, you can use more than one detail row by detail row.

Name
Details
Harold McFlurpy
Show quote
“Our greatest fear should not be of failure… but of succeeding at things in life that don’t really matter.”

link implicit by row ID

If none of the above methods are set, the ID specified in the data-row-id attribute of the parent row data element will be used. The inline-details row should have a inline-details-1234 ID attribute, where "1234" is the ID of the row.

Name
Details
Harold McFlurpy
Show quote
“You're never too old to start learning, and you're never too young to aim high and achieve great things.”

Different types of controls

The .inline-details-toggle doesn't have any styling by itself, and can be put on any element such as a button, a link, or ideally or a .sfe-toggle-more component.

sfe-toggle-more-text
sfe-toggle-more
sfe-button
plain link
Show quote
“When one door of happiness closes, another opens; but often we look so long at the closed door that we do not see the one which has been opened for us.”

Toggle all inline details

Any element with the .inline-details-toggle-all class will open / close all the inline details in the same column of the table.

ID
Name
21758
Harold McFlurpy
“Twenty years from now you will be more disappointed by the things that you didn’t do than by the ones you did do.”
1238
Gilbert Dumont
“Our greatest fear should not be of failure… but of succeeding at things in life that don’t really matter.”

Inline action buttons

sfe-flex-table actions

Optional controls for each row can be added in an element with the actions class within the row.

Those controls will only be displayed on rollover.

Try hovering a line to see the inline buttons

ID
Name
Favorite quote
26326
Harold McFlurpy
“Twenty years from now you will be more disappointed by the things that you didn’t do than by the ones you did do.”
83927
Caroline Müller
“When one door of happiness closes, another opens; but often we look so long at the closed door that we do not see the one which has been opened for us.”
25412
Gilbert Dumont
“Our greatest fear should not be of failure… but of succeeding at things in life that don’t really matter.”

Automatic pagination

paged

This is an example for pagination on a flex table. See the automatic pagination documentation.

Name
Juliette Danielle
Tommy Wiseau
Harold McFlurpy
Francesca Monterosa
Gilbert Dumont
Roger Taylor
Antonio Spaghetti
Hubert de Montmirail
Maria Bueno
Mary-Ann Eisel
Peter Curtis
Grigori Yefimovich Rasputin
Marty Riessen
Robert Lutz
Betty Stöve
Andrés Gómez
Slobodan Živojinović
Heinz Günthardt
Alexander Volkov
Philippe Coutinho Correia
Margaret Court
Lucas Coelho de Lima
Marty Riessen
Frederic Johnson

Column reorder

table-reorder-columns

Add the table-reorder-columns class to a table to make the columns sortable by drag and drop.

The columns order is automatically saved to the user's local storage and applied on page load.

Note: add the fixed-column class to a column header to make the column unmoveable.

Note: The ID of the table is used as key for the settings saved in local storage. If the table has no ID, a hash is created using the header's content. This means changing the header on a table with no ID will reset the settings for all users.

ID
Name
City
Country
26326
Harold McFlurpy
London
United Kingdom
84236
Yoshiki Ishimura
Tokyo
Japan
83927
Caroline Müller
Berlin
Germany

Table settings

layout-control-density-switch, layout-control-stripe-switch, layout-control-columns-list

Add empty divs with the following classes to add controls for the table styling. The divs will be automatically filled with the correct markup.

layout-control-columns-list lets the user control which colums are displayed. When the user moves columns, the position of the checkboxes is also changed

layout-control-density-switch lets the user control the information density of the table.

layout-control-stripe-switch lets the user control whether the table is striped or not.

The table settings are automatically saved to the user's local storage and applied on page load.

Note: those divs must be somewhere in the table's parent node to work.

Note: add the fixed-column class to a column header to prevent the user from hiding a column.

Note: The ID of the table is used as key for the settings saved in local storage. If the table has no ID, a hash is created using the header's content. This means changing the header on a table with no ID will reset the settings for all users.

Note: those controls fit particularly well in a sfe-dropdown-panel above the table.




ID
Name
City
Country
Profession
26326
Harold McFlurpy
Melbourne
Australia
Carpenter
84236
Yoshiki Ishimura
Tokyo
Japan
Banker
83927
Caroline Müller
Berlin
Germany
Industrial designer

Callback functions

table.addCallback(hook, function)

It's possible to extend the table functionalities using hooks and callback functions.

The first argument is a string with the name of the hook. See the list below.

The second argument is the callback function itself. The table will be passed as argument to the callback function.

List of hooks:

  • toggleControlsUpdate: called each time the controls on the action bar are updated, at the selection of a row or change the complete count of rows.

Note: New hooks can be added easily if needed. Please consult with the UI team.

ID
Name
Favorite quote
26326
Harold McFlurpy
83927
Caroline Müller
25412
Gilbert Dumont
The callback has been called 0 times.

Modals

Lightbox modal

sfe-modal lightbox

Creating a modal is trivial and doesn't require to write any JavaScript in its simplest form.

It takes two components: a modal trigger (typically a button) and the modal itself.

Any element can be made a trigger by simply adding the sfe-open-modal to it. The ID of the related modal must be in the data-modal-target attribute.

The modal itself can be placed anywhere in the dom. It will be hidden by default, and displayed when the user clicks the trigger.The modal must be identified by a unique ID attribute. It can contain anything, most notably forms.

In the following example, the modal is open via a custom javascript function attached to the button.

The code below is the simplest way to open a modal in Javascript.

Contextual modal

sfe-modal contextual

Works the same as a lightbox, but doesn't obscure the screen. This is better for user experience, as it doesn't interrupt the user flow. It will opens jest below or above the trigger that opened the modal, depending on the position in the window.

The first example works without javascript:

Note: When the modal contains a field, add the modal-focus-field class to focus on it automatically when the modal opens. This will save users a click.

Basic example

This is a really basic example that simply opens a modal. No javscript is required to make it work.

Modal title

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Advanced example

This example works with javascript.

The open function is attached to the trigger button, and a custom function that triggers a notification is attached to the action button:

Modal title

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Search builder

Search conditions

sfe-search-builder sfe-search-condition

Use this component to compose complex searches out of individual conditions, such as on the order list.

Each condition shows a field and its value. Clicking a condition opens a contextual modal to edit it, and the cross that appears on hover removes it.

Link a condition to its modal with the sfe-open-modal class and the data-modal-target attribute. Add the no-condition class to the operation element when the field isn't filtering anything.

Shop Shop 1, Shop 4
Gift wrap Yes
Total Over ¥10,000
Status All

Shop




Gift wrap

Total

Status



Add a condition