Text Elements
Add text to your stories through the Text pane in the library panel.Text Pane
Access text tools from the library sidebar:packages/story-editor/src/components/library/paneIds.ts:20
Text Presets
Pre-designed text styles for quick insertion:packages/story-editor/src/components/library/panes/text/textPresets.ts
Text Sets
Combinations of text elements that work together:packages/story-editor/src/components/canvas/useInsertTextSet.js
Text Editing
Entering Edit Mode
Reference:
packages/story-editor/src/components/canvas/editElement.js
Rich Text Editing
Text elements support rich formatting through the@googleforcreators/rich-text package:
- Bold -
Cmd/Ctrl + B - Italic -
Cmd/Ctrl + I - Underline -
Cmd/Ctrl + U - Alignment - Left, center, right, justify
packages/rich-text/
Text Style Panel
The Text Style panel in the Design sidebar provides comprehensive styling controls.Panel Structure
packages/story-editor/src/components/panels/design/textStyle/textStyle.js:42-48
Font Controls
Font Picker
Select fonts from available options:packages/story-editor/src/components/fontPicker/
Font Provider
Fonts are managed through the Font Provider:- Loading system fonts
- Custom font uploads
- Google Fonts integration
- Font preloading for performance
packages/story-editor/src/storyEditor.js:86
Story Font Picker
Manage fonts at the story level:packages/story-editor/src/components/storyFontPicker/
Font Properties
Font Size
Adjust text size with precise control:- Input field - Enter exact pixel values
- Slider - Visual adjustment
- Presets - Common sizes (12px, 16px, 24px, 36px, 48px, 72px)
Font Weight
Select from available weights:- Thin (100)
- Light (300)
- Regular (400)
- Medium (500)
- Semi-Bold (600)
- Bold (700)
- Black (900)
Available weights depend on the selected font family. Not all fonts include all weights.
Letter Spacing
Adjust spacing between characters:- Range: -0.5em to 1em
- Default: 0em
- Fine-tune for visual appeal
Line Height
Control spacing between lines:- Range: 0.5 to 3.0
- Default: 1.2
- Larger values increase readability for long text
Color Controls
Text Color
Set the color of text:packages/story-editor/src/components/panels/design/textStyle/color.js
Color Picker
The color picker provides multiple input methods:- Color Swatches
- Hex Input
- Color Picker
Select from story color presets for brand consistency.Presets are defined at the story level and shared across all elements.
Eyedropper Tool
Sample colors from the canvas:packages/story-editor/src/components/eyedropper/
Background Color
Add background colors to text for emphasis:- Solid colors
- Gradient backgrounds
- Opacity control
- Padding adjustment
packages/story-editor/src/components/panels/design/textStyle/backgroundColor.js
Padding Controls
Adjust spacing around text:- All sides (uniform)
- Individual sides (top, right, bottom, left)
packages/story-editor/src/components/panels/design/textStyle/padding.js
Text Alignment
Align text within its container:- Left align
- Center align
- Right align
- Justify
packages/story-editor/src/components/panels/design/alignment/
Style Presets
Save and reuse text styles:Creating Style Presets
Reference:
packages/story-editor/src/components/library/panes/text/stylePresets/
Style Presets Panel
packages/story-editor/src/components/panels/design/textStyle/stylePresets/
Text Accessibility
Ensure text is accessible to all users:Color Contrast
The editor checks color contrast automatically:packages/story-editor/src/components/panels/design/textStyle/textStyle.js:94-100
Contrast Warnings
When text doesn’t meet WCAG contrast requirements:packages/story-editor/src/components/panels/design/textStyle/textStyle.js:36
Text Accessibility Panel
Additional accessibility controls:packages/story-editor/src/components/panels/design/textAccessibility/
Advanced Text Styling
Text Effects
Apply visual effects:- Shadow - Add drop shadows
- Outline - Stroke around text
- Gradient fills - Multi-color text
Style Controls
Comprehensive style options:packages/story-editor/src/components/panels/design/textStyle/style.js
Font Preview
Preview fonts before applying:packages/story-editor/src/components/library/panes/text/fontPreview.js
Inserting Text Presets
Use pre-designed text styles:packages/story-editor/src/components/library/panes/text/useInsertPreset.js
Color Presets
Manage story-level color palettes through the Style Manager:- Brand consistency across stories
- Quick color changes
- Palette sharing between elements
packages/story-editor/src/components/styleManager/
Text in Templates
Templates include pre-styled text:- Font combinations tested for visual harmony
- Color schemes that ensure accessibility
- Sizing optimized for readability
- Select text element
- Double-click to edit
- Replace text content
- Styles remain applied
Best Practices
Mind text length
Keep text concise - Web Stories are visual-first. Aim for 1-2 sentences per element.
Highlights System
The editor uses highlights to guide text styling:- Draw attention to relevant controls
- Guide users through styling tasks
- Provide contextual help
packages/story-editor/src/components/panels/design/textStyle/textStyle.js:67-73
Keyboard Shortcuts
Speed up text editing:- Bold -
Cmd/Ctrl + B - Italic -
Cmd/Ctrl + I - Underline -
Cmd/Ctrl + U - Select All -
Cmd/Ctrl + A - Copy -
Cmd/Ctrl + C - Paste -
Cmd/Ctrl + V - Undo -
Cmd/Ctrl + Z - Redo -
Cmd/Ctrl + Shift + Z
Size and Position
Precise text element positioning:packages/story-editor/src/components/panels/design/textStyle/textStyle.js:79-80
Text Icon
Represent text in the library:packages/story-editor/src/components/library/panes/text/textIcon.js
Next Steps
Animations
Add animations to text elements
Templates
Use templates with pre-designed text styles
Creating Stories
Learn the basics of story creation