configure()

Specification

Applies global layout configuration.

Calling Layout.configure() on your application's root mount is usually a good place:

import React, { useEffect } from 'react'
import ReactDOM from 'react-dom'
import Layout from 'atomic-layout'

const App = () => {
  useEffect(() => {
    // A single call to configure layout upon App's mount
    Layout.configure(options)
  }, [])
  
  return <Tree />
}

ReactDOM.render(<App />, document.getElementById('root'))

Options

defaultUnit

Value type

String

Default value

px

Description

Default measurement unit used as a suffix for numeric prop values.

Example

defaultBehavior

Value type

up | down | only

Default value

up

Description

Breakpoint behavior used for responsive props without explicit behavior.

Example

Template prop value is applied for md breakpoint and down, as contrary to the default, mobile-first behavior, which applies the value from the given breakpoint and up.

breakpoints

Value type

TBreakpoints

Default value

Bootstrap 4 breakpoints

Description

A map of custom breakpoints.

Type definition

Example

defaultBreakpointName

Value type

String

Default value

"xs"

Description

The name of a default breakpoint used for the props without an explicit breakpoint suffix.

Example

Breakpoint-less padding prop is now applied on the mobile breakpoint by default.

Last updated