--- title: "toBorder" description: "This function is used specifically when binding a Border property on a component. Typically, this is used with a Container or Label component but can be used on any component that has a Border property." --- # toBorder > This function is used specifically when binding a Border property on a component. Typically, this is used with a Container or Label component but can be used on any component that has a Border property. **This function is used by Ignition's Expression language.**. ## Description This function takes a string and converts it into a border. The string must be a semi-colon separated list of values. The first value is the name of the border, and the other values depend on the type of border you use. The following table defines the border types and the arguments they accept. |Border Type | Options | Type | Style | Font Justification | |--- |--- |--- |--- |--- | | bevel | bevelType | 0 = Raised1 = Lowered1010 = Double | | | | button | none | | | | | etched | etchType | 0 = Raised1 = Lowered | | | | etchedtitled | title; style; fontJustification; fontPosition; fontColor; font | | 0 = Etched / Lowered1 = Etched / Raised2 = Beveled / Lowered3 = Beveled / Raised4 = Beveled / Double5 = Standard | 1 = Left2 = Center3 = Right4 = Leading5 = Trailing | | field | none | | | | | line | color; thickness | | | | | linetitled | title; width; lineColor; fontJustification; fontPosition; fontColor; font | | | 1 = Left2 = Center3 = Right4 = Leading5 = Trailing | | matte | color; topWidth, leftWidth; bottomWidth; rightWidth | | | | | paneltitled | title; style; mainColor; bgColor, shadowSize, fontJustification; fontPosition; fontColor;font | | 1=Gradient / West-to-East2=Gradient / North-to-South3=Gradient / East-to-West4=Solid | 1 = Left2 = Center3 = Right4 = Leading5 = Trailing | To use this function, you need to include the border type and then any options you want to use in the correct order. ie: ``` toBorder("paneltitled; title; style; mainColor; bgColor; shadowSize; fontJustification; fontPosition; fontColor;font") ``` ## Syntax `toBorder(value[, failover])` - Parameters - string **value** - The value to type cast. - object **failover** - Optional. The failover value if type casting fails. - Results - Border - The value type cast as a border object. ## Examples ```python title="Code Snippet" toBorder("bevel;1010") //returns this... ``` ![](toBorderImgs/border1.png) ```python title="Code Snippet" toBorder("button") ``` ![](toBorderImgs/border2.png) ```python title="Code Snippet" toBorder("etched;0") ``` ![](toBorderImgs/border3.png) ```python title="Code Snippet" toBorder("etchedtitled;Title;5;3;right;green;Arial") ``` ![](toBorderImgs/border4.png) ```python title="Code Snippet" toBorder("field") ``` ![](toBorderImgs/border5.png) ```python title="Code Snippet" toBorder("line;blue;2") ``` ![](toBorderImgs/border6.png) ```python title="Code Snippet" toBorder("linetitled;Title") //returns this... ``` ![](toBorderImgs/border7.png) ```python title="Code Snippet" toBorder("matte;red;10;1;1;1") //returns this... ``` ![](toBorderImgs/border8.png) ```python title="Code Snippet" toBorder("paneltitled;Options;1;grey;white;0;3;0;green;Dialog,bold,16") //returns this... ``` ![](toBorderImgs/border9.png)