![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@carbon/grid
Advanced tools
> Grid for digital and software products using the Carbon Design System.
@carbon/grid
Grid for digital and software products using the Carbon Design System.
Run the following command using npm:
npm install -S @carbon/grid
If you prefer Yarn, use the following command instead:
yarn add @carbon/grid
@carbon/grid
has three primitive class types to use in order to structure your
application. They include:
bx--grid
, defines the overall grid context and sets some useful attributes
like width and marginbx--row
, defines a row of items in a gridbx--col
, used to define individual columnsYou can use a combination of these classes to build a layout. For example, if we wanted a 4 column layout for a small breakpoint we could use the following markup:
<div class="bx--grid">
<div class="bx--row">
<div class="bx--col">1/4</div>
<div class="bx--col">1/4</div>
<div class="bx--col">1/4</div>
<div class="bx--col">1/4</div>
</div>
</div>
While this layout can work for some grid usage scenarios, we probably will want more control over how many columns our layout will span at each given breakpoint.
By default, @carbon/grid
uses the breakpoints defined in @carbon/layout
.
There are five breakpoints: sm
, md
, lg
, xlg
, and max
. You can use each
one in combination with a column to specify the number of columns to span at a
given breakpoint. For example, we could rewrite the above example to be:
<div class="bx--grid">
<div class="bx--row">
<div class="bx--col-sm-1">1/4</div>
<div class="bx--col-sm-1">1/4</div>
<div class="bx--col-sm-1">1/4</div>
<div class="bx--col-sm-1">1/4</div>
</div>
</div>
The .bx--col-sm-1
class names tells us that this <div>
should only span one
column at our sm
breakpoint. By default, as we scale beyond the breakpoint the
layout will still take up a percentage of the overall width.
Class name | Description |
---|---|
.bx--grid | Use at the top-level of your project to define a grid for a section of the page |
.bx--grid--bleed | Collapse all the gutters in the layout. Useful alongside .bx--grid--padding |
.bx--grid--padding | Apply padding to the content of every column in the layout |
.bx--grid--hang | Tell the grid to drop the left (or right) gutter from the overall layout. Useful for hanging type |
.bx--row | Define a row inside of a grid. |
.bx--col , .bx--col--auto | Define a column that spans as much width as available |
.bx--col-<breakpoint>-<span> | Define a column at a breakpoint that spans the given number of columns |
.bx--offset-<breakpoint>-<span> | Define an column at a breakpoint that spans the given number of columns. Can be used on a non-empty column. |
To learn more about how to contribute, look here!
FAQs
Grid for digital and software products using the Carbon Design System
The npm package @carbon/grid receives a total of 86,392 weekly downloads. As such, @carbon/grid popularity was classified as popular.
We found that @carbon/grid demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 9 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.