Skip to content

Commit e940ae2

Browse files
empty_state component added
1 parent 90d4b01 commit e940ae2

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
INSERT INTO component(name, icon, description, introduced_in_version) VALUES
2+
('empty_state', 'info-circle', 'Empty states are placeholders for first-use, empty data, or error screens', '0.35.0');
3+
4+
INSERT INTO parameter(component, name, description, type, top_level, optional) SELECT 'empty_state', * FROM (VALUES
5+
('title','Description of the empty state.','TEXT',TRUE,FALSE),
6+
('status_code','HTTP status code displayed on the top of the empty state.','INTEGER',TRUE,TRUE),
7+
('icon','Name of an icon to be displayed on the top of the empty state.','ICON',TRUE,TRUE),
8+
('image','The URL (absolute or relative) of an image to display at the top of the empty state.','URL',TRUE,TRUE),
9+
('information','A short text displayed below the title.','TEXT',TRUE,FALSE),
10+
('btn_title','The text displayed on the button.','TEXT',TRUE,FALSE),
11+
('btn_icon','Name of an icon to be displayed on the left side of the button.','ICON',TRUE,FALSE),
12+
('link','The URL to which the button should navigate when clicked.','URL',TRUE,FALSE)
13+
) x;
14+
15+
INSERT INTO example(component, description, properties) VALUES
16+
('empty_state', '
17+
The empty_state component provides users with informative and visually appealing placeholders when there is no content to display in a particular section of an application or website. Its role is to enhance user experience by guiding users on what to do next, offering suggestions, or providing context about the absence of data. This component includes a title, a description, an action button and often an illustration or icon. The empty_state component helps to reduce confusion and encourages users to take action.
18+
',
19+
json('[{
20+
"component": "empty_state",
21+
"title": "No results found",
22+
"status_code": 404,
23+
"information": "Try adjusting your search or filter to find what you''re looking for.",
24+
"btn_title": "Search again",
25+
"btn_icon": "search",
26+
"link": "#"
27+
}]'));
28+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<div class="empty">
2+
{{#if status_code}}
3+
<div class="empty-header">{{status_code}}</div>
4+
{{else}}
5+
{{#if icon}}
6+
<div class="empty-icon">
7+
<span>{{icon_img icon }}</span>
8+
</div>
9+
{{else}}
10+
{{#if image}}
11+
<div class="empty-img"><img src="{{image}}" height="128" alt="{{image}}"/></div>
12+
{{/if}}
13+
{{/if}}
14+
{{/if}}
15+
<p class="{{title}}">No results found</p>
16+
<p class="empty-subtitle text-secondary">
17+
{{information}}
18+
</p>
19+
<div class="empty-action">
20+
<a href="{{link}}" class="btn btn-primary">
21+
<span class="me-1">{{icon_img btn_icon}}</span>
22+
{{btn_title}}
23+
</a>
24+
</div>
25+
</div>

0 commit comments

Comments
 (0)