Newskit Logo

Getting started

Design overview

Popular searches

View GitHub

Components

Block

Blocks are simple container components that you can apply style and space to. They’re the equivalent of frames in Figma.

Status

Supported

Introduced

v0.1.0

View codeView StorybookView Design

Interactive demo

This demo lets you preview the block component, its variations and configuration options.

This is a block
Render as
spaceStack
stylePreset
1import React from 'react';
2import { Block } from 'newskit';
3
4export default () => <Block>This is a block</Block>;
5

Anatomy

The block contains one required element.

ItemNameDescriptionComponentOptional

Options

The block has options for different use cases:

Render as

Convert the block to a ‘span’.

Style

Apply styling to the block with style presets .

Spacing

Apply three types of spacing to the block: space inline, space stack and space inset.

Render as

Convert the block to a ‘span’.

Style

Apply styling to the block with style presets .

Spacing

Apply three types of spacing to the block: space inline, space stack and space inset.

Usage

Here’s how and when to use the block:

Use the block to apply spacing and style presets

Use the block as a container to easily apply spacing and style presets around other elements.

Don’t use for equal spacing on multiple elements

Avoid using the block when you need to apply equal spacing to multiple elements. Use stack or grid instead.

Accessibility considerations

The block is an HTML element, so you can use any ARIA attribute (e.g. region). Learn more ARIA at MDN Web Docs.

SEO considerations

There are no SEO considerations for the block.

API

The block has a range of props to define the experience in different use cases.

Block
NameTypeDefaultDescriptionRequired

The block can utilise any valid HTML attribute..

Need Help?

Cant find what you are looking for?

Get In Touch

Need Help?

Cant find what you are looking for?