Revel
GitHub
GitHub
  • Overview

    • Getting started
    • FAQ
    • Release notes
  • Foundations

    • Meet the standard
    • Accessibility
    • Internationalization
    • Information hierarchy
    • Speed
  • Design

    • Visual principles
    • Colors
    • Space
    • Icons
    • Typography
  • Design tokens
  • Style helpers
  • Content

    • Express your ideas
    • Actionable language
    • Inclusive and accessible language
    • Alternative text
    • Grammar and mechanics
      • Basics
      • Capitalization
      • Dates and units of measurement
      • Punctuation
  • Components

    • Alert
    • Avatar
    • Badge
    • Button
    • Button group
    • Checkbox
    • Date Input
      • dates
      • datetimes
      • ranges
    • Field group
    • File upload
    • Flex
    • Grid
    • Icon
    • Image
    • Input
    • Loader
    • Modal
    • Month picker
    • Pagination
    • Popper
    • Radio
    • Repeater
    • Select
    • Tabs
    • Tile
    • Toast
    • Toggle
  • Directives

    • Click outside
    • Tooltip

Flex

A component based on Flexbox for creating layouts.

Usage

import { RFlex, RFlexItem } from "@rebilly/revel";

<r-flex>
    <r-flex-item>...</r-flex-item>
    <r-flex-item>...</r-flex-item>
</r-flex>

Examples

Basic flex

By default, the flex layout expands for 12 columns and will wrap to the next row once the combined cells reach 12 spaces (spans) in total. By default flex items will use the width of their content.

  • Use span="fill" to make the item expand to fill the remaining space.
  • Use flex-none to make the item not grow or shrink.
flex.vue

Keep RFlex columns and RFlexItem span equal or lower than 12.

Nested flex

It is possible to nest flex layouts inside each other.

flex-nested.vue

Wrap

Add the wrap property to a RFlexItem to make the next item continue on the next flex row.

flex-wrap.vue

Offset

Add the offset property to a RFlexItem to move the item to the right.

  • Use auto to make the item span the remaining space.
flex-offset.vue

Avoid using RFlexItem wrap and RFLexItem offset props together.

Responsivess

Flex items will take full width on breakpoint --r-breakpoints-m.

RFlex

Props

NameTypeDefaultDescription
columnsFlexSize'12'

Number of flex columns (1 to 12)

gapGap'6'

Gap between flex columns (0 to 12), or two values separated by a comma for different row and column gaps.

alignItemsNullable, Distributionnull

Align items in the flex container

alignContentNullable, ContentDistributionnull

Align content in the flex container

justifyContentNullable, ContentDistributionnull

Justify content in the flex container

directionNullable, Directionnull

Adjust flex items direction

wrapNullable, Wrapnull

Adjust flex items wrapping

unstackablebooleanfalse

Prevents flex container to stack on smaller screens

Slots

NameDescription
default

Flex items

RFlexItem

Props

NameTypeDefaultDescription
spanunion, FlexSize, "fill", "auto"'auto'

Number of flex columns (1 to 12)

wrapNullable, booleannull

Move to the next row

offsetNullable, unionnull

Move the item to the right."

alignSelfNullable, Distributionnull

Align items in the flex container

flexNonebooleanfalse

Remove flex properties

Slots

NameDescription
default

Edit this page
Last Updated: 10/4/24, 2:04 PM
Contributors: Cesar Level
Prev
File upload
Next
Grid