Class: Irelia::Stack::Preview

Inherits:
ComponentPreview
  • Object
show all
Defined in:
app/components/irelia/stack/preview.rb

Instance Method Summary collapse

Instance Method Details

#default(direction: :horizontal, justify: :flex_start, items: :baseline, grow: false) ⇒ Object

Parameters:

  • direction (defaults to: :horizontal)

    select { choices: [horizontal, horizontal_reverse, vertical, vertical_reverse] } “Direction of the stack”

  • justify (defaults to: :flex_start)

    select { choices: [start, center, between, end, around, evenly, stretch] } “Position along main axis”

  • items (defaults to: :baseline)

    select { choices: [flex_start, center, flex_end, baseline, stretch] } “Position along cross axis”

  • grow (defaults to: false)

    toggle “Grow items to fill space”



13
14
15
16
17
18
19
20
# File 'app/components/irelia/stack/preview.rb', line 13

def default(direction: :horizontal, justify: :flex_start, items: :baseline, grow: false)
  render_with_template(locals: {
    direction: direction,
    justify: justify,
    items: items,
    grow: grow
  })
end

#horizontal(justify: :flex_start, items: :baseline, grow: false) ⇒ Object

Parameters:

  • justify (defaults to: :flex_start)

    select { choices: [start, center, between, end, around, evenly, stretch] } “Position along main axis”

  • items (defaults to: :baseline)

    select { choices: [flex_start, center, flex_end, baseline, stretch] } “Position along cross axis”

  • grow (defaults to: false)

    toggle “Grow items to fill space”



27
28
29
30
31
32
33
# File 'app/components/irelia/stack/preview.rb', line 27

def horizontal(justify: :flex_start, items: :baseline, grow: false)
  render_with_template(locals: {
    justify: justify,
    items: items,
    grow: grow
  })
end

#vertical(justify: :flex_start, items: :baseline, grow: false) ⇒ Object

Parameters:

  • justify (defaults to: :flex_start)

    select { choices: [start, center, between, end, around, evenly, stretch] } “Position along main axis”

  • items (defaults to: :baseline)

    select { choices: [flex_start, center, flex_end, baseline, stretch] } “Position along cross axis”

  • grow (defaults to: false)

    toggle “Grow items to fill space”



40
41
42
43
44
45
46
# File 'app/components/irelia/stack/preview.rb', line 40

def vertical(justify: :flex_start, items: :baseline, grow: false)
  render_with_template(locals: {
    justify: justify,
    items: items,
    grow: grow
  })
end