Material Bread
v0.2.10
Home
Getting Started
React Native
Web
Electron
MacOS
Windows
NextJs
Expo
Vue Native
Style
Font
Icons
Theme
Components
Appbar
Searchbar
Appbar Bottom
Avatar
Backdrop
Badge
Banner
Bottom Navigation
Bottom Navigation Item
Button
Card
CardActions
CardContent
CardHeader
CardMedia
Checkbox
Chip
DataTable
DataTableCell
DataTableHeader
DataTablePagination
DataTableRow
Dialog
Divider
Drawer
DrawerHeader
DrawerItem
DrawerSection
DrawerBottom
Fab
Speed dial
Icon
IconButton
List
ListExpand
ListItem
ListSection
Menu
MenuItem
Paper
Progress Bar
Progress Circle
Radio Button
Ripple
Select
SheetBottom
SheetSide
Slider
Snackbar
SwipeNav
Switch
Tabs
Tab
Textfield
Searchfield
ToggleButton
ToggleButtonGroup
Tooltip
Typography
Utils
Anchor
Color
Hoverable
Shadow
Storybook
Showcase
Contributing
Library
Docs
About

Divider

A divider is a thin line that groups content in lists and layouts. - Material Docs

import { Divider } from 'material-bread';

Component #

A Divider can be used in most components to create a visible separation between sections
Live Editing
class Dividers extends React.Component {
  constructor(props) {
    super(props)
  }
  render() {
    return (
      <View>
        <Divider />
        <Divider />
        <Divider marginVertical={24} />
      </View>
    );
  }
}

Usage #

import React, { Component } from 'react';
import { View } from 'react-native';
import { Divider } from 'material-bread';

class Dividerpage extends Component {
    constructor(props) {
      super(props)
    }
    render() {
      return (
        <View>
          <Divider />
        </View>
      );
    }
}

Props #

Name
Description
Type
Default
insetHeader
Subheader inset number
number
insetLeft
Inset of Divider from left
number
marginVertical
Adds magin on top and bottom for spacing
number
style
Styles root element
object
subheader
Displays under a divider as text
string

Demos #

You can see even more examples in the Storybook environment.

Subheader #

Subheader
Title
Section
Live Editing
class DialogPage extends React.Component {
  constructor(props) {
    super(props)
  }
  render() {
    return (
      <View >    
        <Divider subheader={'Subheader'} />
        <Divider subheader={'Title'} insetHeader={8} />
        <Divider subheader={'Section'} insetHeader={16} marginVertical={24} />
      </View>
    );
  }
}

InsetLeft #

insetLeft shortens the width of the divider by the provided amount and moves the Divider to the right by that amount. This is useful for keeping the Divider inline with other elements.
Favorites
Janet Perkins
Mary Perkins
Peter Carlsson
Trevor Hansen
Live Editing
class DialogPage extends React.Component {
  constructor(props) {
    super(props)
  }
  render() {
    return (
        <List subheader={'Favorites'} style={{ width: 300 }}>
        <ListItem
          text={'Janet Perkins'}
          media={
            <Avatar
              type="icon"
              content="person"
              contentColor={'#ececec'}
              color={'#a3a3a3'}
              size={40}
            />
          }
        />

        <ListItem
          text={'Mary Perkins'}
          media={
            <Avatar
              type="icon"
              content="person"
              contentColor={'#ececec'}
              color={'#a3a3a3'}
              size={40}
            />
          }
        />
        <Divider insetLeft={20} />
        <ListItem
          text={'Peter Carlsson'}
          media={
            <Avatar
              type="icon"
              content="person"
              contentColor={'#ececec'}
              color={'#a3a3a3'}
              size={40}
            />
          }
        />
        <ListItem
          text={'Trevor Hansen'}
          media={
            <Avatar
              type="icon"
              content="person"
              contentColor={'#ececec'}
              color={'#a3a3a3'}
              size={40}
            />
          }
        />
     
      </List>
    );
  }
}