Add pre-built shapes to your slides with Podium.add_auto_shape/3. Podium includes 187 shape presets covering rectangles, arrows, stars, callouts, flowchart symbols, and more -- each with full control over fills, lines, and rotation.

Try it yourself

Run mix run demos/shapes-and-styling.exs to generate a presentation with all the examples from this guide.

slide = Podium.add_auto_shape(slide, :rounded_rectangle,
  x: {1, :inches}, y: {2, :inches},
  width: {3, :inches}, height: {1, :inches},
  fill: "4472C4", text: "Status: Active")

Adding Auto Shapes

Use Podium.add_auto_shape/3 with a preset atom, position, and size:

prs = Podium.new()
slide = Podium.Slide.new()

slide =
  slide
  |> Podium.add_auto_shape(:rectangle,
    x: {0.5, :inches}, y: {1.5, :inches},
    width: {4, :inches}, height: {2, :inches}, fill: "4472C4")
  |> Podium.add_auto_shape(:oval,
    x: {5.5, :inches}, y: {1.5, :inches},
    width: {2, :inches}, height: {2, :inches}, fill: "ED7D31")

Shape gallery with rectangles, ovals, arrows, stars, and more

Common Presets

CategoryPresets
Basic:rectangle, :rounded_rectangle, :oval, :diamond, :hexagon, :octagon
Arrows:right_arrow, :left_arrow, :up_arrow, :down_arrow, :bent_arrow, :chevron
Stars:star_4_point, :star_5_point, :star_6_point, :star_8_point, :star_12_point
Callouts:balloon, :oval_callout, :rectangular_callout, :cloud_callout
Flowchart:flowchart_process, :flowchart_decision, :flowchart_terminator, :flowchart_data
Math:math_plus, :math_minus, :math_multiply, :math_divide, :math_equal

Call Podium.AutoShapeType.all_types/0 for the full sorted list of all 187 presets.

slide = Podium.add_auto_shape(slide, :rounded_rectangle,
  x: {2, :inches}, y: {2, :inches},
  width: {4, :inches}, height: {1.5, :inches},
  fill: "003366",
  text: [{[
    {"Revenue: ", color: "FFFFFF"},
    {"$4.2M", bold: true, color: "00FF00"}
  ], alignment: :center}])

Solid, gradient, and pattern fills on shapes

Fill Types

Every shape accepts a :fill option. Podium supports four fill types.

Solid Fill

Pass an RGB hex string:

slide = Podium.add_auto_shape(slide, :rectangle,
  x: {1, :inches}, y: {1, :inches},
  width: {4, :inches}, height: {2, :inches}, fill: "FF6347")

Gradient Fill

Pass a {:gradient, stops, opts} tuple. Each stop is a {position, color} pair where position ranges from 0 to 100_000:

slide = Podium.add_auto_shape(slide, :rounded_rectangle,
  x: {1, :inches}, y: {1, :inches},
  width: {5, :inches}, height: {2, :inches},
  fill: {:gradient, [{0, "003366"}, {100_000, "66CCFF"}], angle: 5_400_000})

The :angle option is in 60,000ths of a degree. 5_400_000 is 90 degrees (top to bottom).

Pattern Fill

Pass a {:pattern, preset, opts} tuple. Podium supports all 54 OOXML pattern presets:

slide = Podium.add_auto_shape(slide, :rectangle,
  x: {1, :inches}, y: {1, :inches},
  width: {4, :inches}, height: {2, :inches},
  fill: {:pattern, :dn_diag, foreground: "4472C4", background: "FFFFFF"})

Common presets include :dn_diag, :up_diag, :lt_horz, :lt_vert, :cross, :diag_cross, :sm_grid, :lg_grid, :wave, :plaid, and percentage fills from :pct_5 through :pct_90. See Podium.Pattern for the full list.

No Fill

Omitting :fill on an auto shape lets the theme's default styling apply. Setting fill: nil on a text box explicitly removes the fill, producing a transparent shape.

Solid, dashed, dotted, and gradient line styles

Line Types

The :line option controls the shape's outline.

Solid Line

Pass an RGB hex string for a default-width line, or a keyword list for more control:

# Default width
slide = Podium.add_auto_shape(slide, :rectangle,
  x: {1, :inches}, y: {1, :inches},
  width: {4, :inches}, height: {2, :inches}, line: "003366")

# Custom width and dash
slide = Podium.add_auto_shape(slide, :oval,
  x: {6, :inches}, y: {1, :inches},
  width: {3, :inches}, height: {3, :inches},
  line: [color: "FF0000", width: {2, :pt}, dash_style: :dash])

Line options: :color (hex string), :width (e.g. {1.5, :pt}), :dash_style

Dash styles: :solid, :dash, :dot, :dash_dot, :long_dash, :long_dash_dot, :long_dash_dot_dot, :sys_dot, :sys_dash, :sys_dash_dot, :sys_dash_dot_dot

Gradient and Pattern Lines

Lines can use gradient and pattern fills by passing :fill instead of :color:

slide = Podium.add_auto_shape(slide, :rectangle,
  x: {1, :inches}, y: {1, :inches},
  width: {4, :inches}, height: {2, :inches},
  line: [fill: {:gradient, [{0, "FF0000"}, {100_000, "0000FF"}], angle: 5_400_000}])

Rotation

Rotate any shape with :rotation, specified in degrees clockwise:

slide = Podium.add_auto_shape(slide, :cross,
  x: {5, :inches}, y: {2, :inches},
  width: {2, :inches}, height: {2, :inches}, rotation: 45)

Text Inside Shapes

Add text with the :text option. It supports the same plain string and rich text formats as Podium.add_text_box/3:

Rich text inside shapes with rotation

Shapes also support :font_size, :alignment, :auto_size, and :word_wrap.

Theme Styling

When you omit :fill on an auto shape, PowerPoint applies the slide master's theme colors. This gives shapes a consistent look that matches the presentation's color scheme. Setting an explicit fill overrides the theme.

Auto Shape Options

OptionTypeDefaultDescription
:xemu_specrequiredHorizontal position
:yemu_specrequiredVertical position
:widthemu_specrequiredShape width
:heightemu_specrequiredShape height
:fillfill_specnilFill color or fill tuple
:lineline_specnilLine color or line opts
:texttext_specnilText content inside shape
:font_sizenumbernilDefault font size (points)
:alignmentatomnilDefault text alignment
:rotationnumbernilRotation in degrees clockwise
:auto_sizeatomnil:none, :text_to_fit_shape, or :shape_to_fit_text
:word_wrapbooleantrueSet to false for single-line text
:margin_leftemu_specnilLeft text margin
:margin_rightemu_specnilRight text margin
:margin_topemu_specnilTop text margin
:margin_bottomemu_specnilBottom text margin

Positions and sizes accept EMU integers or {value, unit} tuples where unit is :inches, :cm, or :pt.


For structured data display, see the Tables guide.