Feathery Docs
HomeCommunityGitHub
  • Platform
    • Quickstart
    • Form Fields
      • Hidden Fields
      • How to Set Field Values
      • Link Fields Across Forms
      • Custom Field Input Format
    • Build Forms
      • Elements
        • Basic
          • Container
          • Button
          • Text
          • Progress Bar
          • Image
          • PDF Viewer
          • Video
          • Table
          • Tooltip
        • Fields
          • Address
            • Street Address Line 1
            • Street Address Line 2
            • City
            • State
            • Country
            • Zip Code
          • Button Group
          • Checkbox
          • Checkbox Group
          • Color Picker
          • Combobox
          • Dropdown
          • Dropdown Multiselect
          • Date Selector
          • Time Selector
          • Email
          • File Upload
          • Matrix
          • Number
          • Password
          • Picture Choice
          • Pin Input
          • Phone Number
          • Radio Group
          • Rating
          • Signature
            • Legally Binding Signatures
          • Slider
          • Social Security Number
          • Text Area
          • Text Field
          • Payment Method
          • URL
        • Custom HTML, JS, CSS, and Iframes
        • Custom Fields
      • Design
        • Reuse styles and elements
          • Styling
          • Assets
        • Alignment and Spacing
        • Sizing Forms and Elements
        • Responsive Layouts
      • Actions
      • Logic
        • Navigate Steps Conditionally
        • Show Elements Conditionally
        • Custom Field Validation
        • Available Conditions
        • Display Dynamic Text
        • Dynamically Repeating Containers
      • Advanced Logic & API Connections
        • Visual Rule Builder
          • Connect to API Action
            • Salesforce API Connector
          • Set Field Value Action
          • Navigate Step Action
          • Set Field Error Action
          • Open URL Action
          • Set Calendly URL Action
        • Javascript Rule Builder
          • API Connections in Code
          • Trigger Integrations from Logic
          • Reusable Logic Configs
        • Examples
          • API Connectors
            • Dynamic dropdown options
            • Dynamic form navigation
            • Pre-fill form from Salesforce
            • Pre-fill form from Hubspot
            • Pre-fill field options from Google Sheets
            • Generate ChatGPT Message
          • Field Validation
            • Complex Field Validation
            • Date and Time Validations
          • Initialize Date Field
          • Dynamically set field placeholder
          • Randomize Field Option Order
          • Update field options based on previous selection
      • Integrations
        • Event Triggers
        • Examples
          • Upload Files to Google Drive
      • Dev & Staging Environments
    • Launch Forms
      • Embed Your Forms
      • Custom URLs & SEO
      • User Tracking
      • Completion Criteria
      • UTM Parameters
      • Accessibility Standards
      • Analytics
      • A/B Testing
      • Offline Mode
    • Document Intelligence
      • Review Extractions
      • Post Processing
      • Supported Document Types
      • Prompting Guide
      • Examples
        • Investment Report
    • Document Autofill & Signatures
      • Autofill Document Templates
        • PDF Autofill
        • Word Doc Autofill
          • Dynamic Tables
        • Excel Autofill
        • PowerPoint Autofill
        • InDesign Autofill
      • Signature Workflows
        • Signature Notifications
        • Access Signed Documents
        • 21 CFR Part 11 Compliance
      • Export Form Submission PDF
    • Workflows
      • Collaboration
        • Email Invite
        • Start Directly
        • Anonymous Starts
      • Review, Edit & Approve
      • Unique Submission Links
    • Enterprise Compliance
      • Security and Privacy
      • Reliability and Performance
      • Document Management
      • Data Sovereignty
    • International Forms
      • Translate Forms
      • Right to Left (RTL) Support
      • International Form Fields
    • White Label Feathery
      • Build Custom Form Fields
      • Offer Custom Form Templates
      • Custom Dashboard Domain
    • Account Settings
      • Managing Your Team
      • Permissions and User Groups
      • Account Attributes
    • FAQs
      • Account & Billing
  • Guides
    • Verify Submissions & Prevent Spam
    • Build a Login or Verification Flow
      • Connect an Auth Integration
      • Add Auth Methods
        • Email SMS Code
        • Email Magic Link
        • Phone Number Verification
        • Social Logins
          • Google
          • Amazon
          • Apple
          • Bitbucket
          • Coinbase
          • Discord
          • Facebook
          • GitHub
          • GitLab
          • LinkedIn
          • Microsoft
          • Slack
          • Twitch
          • Twitter
      • (Optional) Require Auth for Onboarding Steps
      • (Optional) Add Login Flow to Your Site
        • Feathery-Hosted (Recommended)
        • Embed Login Flow
          • Login Embed Tutorial
    • Build a Payment Flow
      • Connect to Stripe
      • Select Products or Plans
      • Collect Payment Method
      • Purchase Products
    • Send Custom SMS Messages
    • Salesforce Picklist Options
  • Developers
    • React SDK
      • API Guide
        • init()
        • <Form>
          • contextRef
          • Event Handlers
            • onSubmit()
            • onLoad()
            • onChange()
            • onAction()
            • onError()
            • onFormComplete()
            • onView()
          • Custom JSX Components
          • PopupOptions
          • initialLoader
        • getFieldValues()
        • setFieldValues()
        • updateUserId()
        • Login API
          • <LoginForm>
          • useAuthClient()
      • Inline vs Popup Form
    • Javascript SDK
    • Context API
      • Field Object
      • field.setStyles()
      • Deprecated Context API
    • REST API
Powered by GitBook
On this page

Was this helpful?

  1. Developers
  2. Context API

field.setStyles()

The API for setting field styles

PreviousField ObjectNextDeprecated Context API

Last updated 1 year ago

Was this helpful?

Styles can be on a field in your form via the Context API. Note that field styles that are set this way will only last for the current user session.

The following are

Style Attribute
Type
Description

width

number

Width of the field

width_unit

px | %

The unit of the width value

height

number

Height of the field

height_unit

px | %

The unit of the height value

font_color

hex string

Font color of field

font_italic

boolean

Is field font italicized

font_weight

number

Font weight of field

font_size

number

Font size of field

font_family

string

Font family of field

font_strike

boolean

Is font strike-through

font_underline

boolean

Is font underlined

line_height

number

The font line height

letter_spacing

number

The font letter spacing

visibility

visibility CSS options

CSS visibility style

horizontal_align

flex-start, center, flex-end

Horizontal field alignment

vertical_align

flex-start, center, flex-end

Vertical field alignment

shadow_x_offset

number

Horizontal offset (in pixels) of the field shadow

shadow_y_offset

number

Vertical offset (in pixels) of the field shadow

shadow_blur_radius

number

Blur radius (in pixels) of the field shadow

shadow_color

hex string

Field shadow color

background_color

hex string

Field background color

hover_background_color

hex string

Field background color when hovered

selected_background_color

hex string

Field background color when selected or active

disabled_background_color

hex string

Background color when field is disabled

hover_font_color

hex string

Font color when hovered

selected_font_color

hex string

Font color when selected or active

disabled_font_color

hex string

Font color when field is disabled

padding_bottom

number

Bottom padding of the field

padding_top

number

Top padding of the field

padding_left

number

Left padding of the field

padding_right

number

Right padding of the field

corner_top_left_radius

number

Top left border radius

corner_top_right_radius

number

Top right border radius

corner_bottom_left_radius

number

Bottom left border radius

corner_bottom_right_radius

number

Bottom right border radius

border_top_color

hex string

Top border color

border_right_color

hex string

Right border color

border_bottom_color

hex string

Bottom border color

border_left_color

hex string

Left border color

border_top_width

number

Top border width in pixels

border_right_width

number

Right border width in pixels

border_bottom_width

number

Bottom border width in pixels

border_left_width

number

Left border width in pixels

border_top_pattern

string

border_right_pattern

string

border_bottom_pattern

string

border_left_pattern

string

Other border styles

For hover styles, prefix the style with hover_. For selected / active styles, prefix with selected_.

The CSS top

The CSS right

The CSS bottom

The CSS left

dynamically set
border style
border style
border style
border style