Skip to content

2. Theme Dictionary

i_82 edited this page Mar 13, 2022 · 7 revisions

Global

Key Type Description
style style tableView.style
foregroundColor color tableView.tintColor
backgroundColor color tableView.backgroundColor
separatorColor color color of separators between cells
backgroundImage string relative path of background image
style Description
InsetGrouped UITableViewStyleInsetGrouped
Grouped UITableViewStyleGrouped
Plain UITableViewStylePlain

Type color, i.e. RGB (RGBA) in hex string, for example, #FF0000 is red.

Header & Footer

Key Type Description
headerTextColor color text color of header
subheaderTextColor color text color of subheader
footerTextColor color color of extra footer text
headerBackgroundColor color background color of header
footerBackgroundColor color background color of footer

Section Header & Footer

Key Type Description
groupHeaderTextColor color text color of section header
groupFooterTextColor color text color of section footer
groupHeaderBackgroundColor color background color of section header
groupFooterBackgroundColor color background color of section footer

Cells

Key Type Description
cellBackgroundColor color cell.backgroundColor
disclosureIndicatorColor color color of disclosure indicator
selectedColor color color of selected cells
highlightedColor color alias of selectedColor
labelColor color cell.textLabel.textColor
valueColor color cell.detailTextLabel.textColor

Inputs

Key Type Description
textColor color input text color
caretColor color input caret color
placeholderColor color input placeholder text color

Switches

Key Type Description
onTintColor color tint color when in ON state
offTintColor color tint color when in OFF state
thumbTintColor color tint color of the small circle area

Tags

Key Type Description
tagTextColor color tag text color
tagSelectedTextColor color tag text color for selected state
tagBackgroundColor color tag background color
tagSelectedBackgroundColor color tag background color for selected state
tagBorderColor color tag border color
tagSelectedBorderColor color tag border color for selected state

Navigation Bar

Key Type Description
navigationBarColor color navigationBar.barTintColor
navigationTitleColor color navigationBar.titleTextAttributes[NSForegroundColorAttributeName]
prefersLargeTitle boolean whether to use large title in navigation bars if possible

Status

Key Type Description
dangerColor color color of error
warningColor color color of warning
successColor color color of success

Theme dictionary can be set for different cells/headers/footers separately.

Clone this wiki locally