It's often easier to have dynamic content output without nested rows, but using row wrappers is the only way for variations like equal height
and vertically divided
to function correctly.
Overview
Why Use Grids?
A grid is a structure, with a very rich history used to align negative space in your design.
Using a grid makes content appear to flow naturally on your page, and allows you to quickly adjust layouts without assigning specific sizes directly to content elements, letting you rapidly prototype and design your page.
Grid Row Spacing
Grid columns have vertical spacing above and below each column to create vertical flow between columns. Consecutive grids will automatically preserve row spacing between grids.
How To Use
Column Flow
A grid does not necessarily need to specify rows. If you include columns
as direct child of ui grid
content will automatically flow to the next row when all the grid columns are taken in the current row.
Column Widths
Column widths can be specified using (x) wide
class names, each row will add up to 16 columns, if a column cannot fit it will automatically flow to the next row
Column Count
Grid or individidual grid rows can be divided evenly using (x) column grid
or (x) column row
Specifying Alignment
You can specify alignment using alignment variations on a grid, row, or column level.
Rows
Using Rows
Specifying wrapping row
elements allows you to manually control line breaks for rows, and use additional row variations.
Responsive Page Grids
Adding Page Gutters
A page grid is a type of grid designed to provide a responsive container for wrapping the entire contents of your page.
Page Grid Breakpoints
Semantic's page grid, by default, uses percentage values for page gutters. This means your page container will constantly adjust as the browser width changes, giving you the largest possible space for each breakpoint.
Grids, rows, and columns can receive responsive classes to make them appear only on a particular device.
Name | Breakpoint | Page Gutter | Responsive Class | Variable |
---|---|---|---|---|
Mobile | Below 768px | 1rem | mobile only | $mobileBreakpoint |
Tablet | Above 768px and below 992px | 8% | tablet only | $tabletBreakpoint |
Computer | Above 992px | 13% | computer only | $computerBreakpoint |
Large Monitor | Above 1400px | 18% | None | $largeMonitorBreakpoint |
Widescreen Monitor | Above 1920px | 23% | None | $widescreenBreakpoint |
Responsive Patterns
Semantic includes two common patterns for adjusting grids on different devices.
A Doubling grid automatically doubles its column width on each device jump. For example, four column computer grid, will jump to a two column grid on tablet, and one column on mobile.
Stackable Grid
Stackable grids will not adjust their column width until mobile, where all grid columns will become full width
Formatting Grids
Content Inside Grids
Previous examples were shaded to help show the physical layout of grids, but grids themselves do not provide any styles.
In order to create content segments inside a grid you must specify individual ui elements
for example ui segments.
Nesting Grids
You can include grids even inside other grids, this can be useful for things like dividing rows inside of a page grid.
Full Width Backgrounds
Grids use negative margins to remove first and last column margins, this means you cannot directly apply a background color on a grid. To add a background try wrapping your grid inside another container, for example a ui segment
.
Second Heading
Second section of content
Second Heading
Second section of content
Row and Column Backgrounds
If you need to specify colors on grid rows of columns, you can use a color variation
Features
First section of content
Statistics
First section of content
Headline
Second section of content
Sitemap
Second section of content
Contact Us
Second section of content
Types
Page Grid
A page grid is used to layout page contents into a grid system.
Welcome to your inbox. Would you like to see more information?
Divided Grid
A grid can have dividers between its columns
How We Collect and Use Information
We ask for certain information such as your username, real name, birthdate, address, phone number and e-mail address when you register for a Semantic UI account, or if you correspond with us. We may also retain any messages you send through the Service, and may collect information you provide in User Content you post to the Service. We use this information to operate, maintain, and provide to you the features and functionality of the Service. Your username and if you choose to disclose it, your real name, will be published publicly. Once published your username and / or real name may not be able to be removed.
Information we may receive from third parties
We may receive information about you from third parties. For example, if you access our websites or Service through a third-party connection or log-in, for example, through Facebook Connect, by “following,” “liking,” adding the Semantic UI application, linking your account to the Semantic UI Service, etc., that third party may pass certain information about your use of its service to Semantic UI. This information could include, but is not limited to, the user ID associated with your account (for example, your Facebook UID), an access token necessary to access that service, any information that you have permitted the third party to share with us, and any information you have made public in connection with that service.
Semantic UI may, in its sole discretion, develop a feature that allows you to invite third parties to the Service. If you choose to use our invitation service to invite a third party to the Service through our “Invite friends” feature, you may directly choose a friend to invite through your mobile device’s native contact list – but we do not require that you import your contacts list to the Service, and we do not retain the information contained in your contacts list. You understand that by inviting a friend to Semantic UI through the “Invite friends” feature, you are directly sending a text or email from your personal accounts and that we are not storing your contact list. In addition, you understand and agree that normal carrier charges apply to communications sent from you phone. Since this invitation is coming directly from your email or phone, we do not have access to or control this communication.
Vertically Divided Grid
A grid can have dividers between rows
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.
Celled Grid
A grid can have rows divided into cells
What are Leaves?
A leaf is an above-ground plant organ. Its main functions are photosynthesis and gas exchange. A leaf is often flat, so it absorbs the most light, and thin, so that the sunlight can get to the chloroplasts in the cells.
Types of Leaves
Leaves come in many shapes and sizes. The biggest undivided leaf is that of a giant edible aroid. This lives in marshy parts of the tropical rain forest of Borneo.
One of its leaves can be ten feet across and have a surface area of over 30 square feet.
Elements
Rows
A row is used to create vertical padding between groups of columns on a page.
Columns
Columns each contain gutters giving them equal spacing from other columns.
Variations
Grid
Column Count
A grid can have a different number of columns per row
Log-in
Register
Padded
A grid can preserve its vertical and horizontal gutters on first and last columns
This paragraph of text will not align with the edges of the first column below because the grid preserves its outter gutters
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.
This paragraph of text will not align vertically with the edges of the first column below because the grid preserves its outter gutters
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.
This paragraph of text will not align horizontally with the edges of the first column below because the grid preserves its outter gutters
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.
Relaxed
A grid can increase its gutters to allow for more negative space
Log-in
Register
Log-in
Register
Doubling
A grid can double its column width on tablet and mobile sizes
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.
Stackable Grid
A grid can have its columns stack on-top of each other after reaching mobile breakpoints
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.
Text Alignment
A grid can specify its text alignment
Vertical Alignment
A grid can specify its vertical alignment to have all its columns vertically centered.
Rows
Responsive to Device
A grid can have its columns, or rows only show content for computer, tablet, or mobile.
Equal Height
A row can specify that it is equal height so all of its columns appear the length of its longest column.
This is a short row
This is a short row
This is a very long row with lots of text in it and way more text than the other rows
It might even span for multiple paragraphs.
Vertical Alignment
A row can also specify its vertical alignment to have its columns vertically centered.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam blandit sagittis elit, nec pharetra justo lobortis vitae. Quisque sed libero ut lacus mattis lacinia. Pellentesque pharetra vel quam sed tristique. Aenean sit amet purus sed sapien suscipit rhoncus. Nunc vel pharetra elit. Integer eleifend in turpis vel suscipit. Mauris porttitor nunc ante, eu vestibulum augue facilisis lacinia. Curabitur blandit urna lorem, et ornare mi laoreet iaculis. Nunc volutpat ultrices libero quis molestie. Nunc ac porta odio. Quisque interdum sodales augue, quis facilisis sem elementum quis.
Columns
Floating
A column can be "floated" to either the left or right of its row.
Column Width
A column can vary in width taking up more than a single grid column.