<ion>

Represents a charged ion specified by element and charge, rendered with its chemical formula

<ion> is a Subject-specific component that represents a charged ion. It renders the element symbol with its charge as a superscript, and exposes the same chemical properties as <atom> along with charge and the appropriate ion name.

Attributes and Properties

Attributes for <ion>

Other (3)

integer. The atomic number of the element.

integer. The charge of the ion (positive for cations, negative for anions).

text. The chemical symbol of the element (e.g. "Na", "Cl").

Common to all components (9)
copy

reference. Create an independent copy of another component by reference. Enter a references a $name.

disabled

boolean. Default value: false. Whether this component is disabled and cannot be interacted with.

extend

reference. Extend another component by reference, inheriting its children and attributes. Enter a reference as $name.

fixed

boolean. Default value: false. Whether this component's value is fixed and cannot be modified.

fixLocation

boolean. Default value: false. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).

hide

boolean. Default value: false. Whether to hide this component from the rendered output.

isResponse

boolean. Default value: false. Whether this component is treated as a response for the purposes of assessment.

name

text. The name used to reference this component from elsewhere in the document.

styleNumber

integer. Default value: 1. The style number used to select this component's visual styling from the available style definitions.

Properties for <ion name="i">

Other (18)

integer. The atomic number of the element.

$i.backgroundColor

text. Human-readable name for this component's background color, derived from the active style and theme.

integer. The charge of the ion.

$i.disabled

boolean. Whether this component is disabled and cannot be interacted with.

$i.fixed

boolean. Whether this component's value is fixed and cannot be modified.

$i.fixLocation

boolean. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).

$i.group

integer. The group number of the underlying element in the periodic table.

$i.groupName

text. The descriptive name of the underlying element's periodic group.

$i.hidden

boolean. Whether this component is hidden from the rendered output.

latex. The ion rendered as a LaTeX string.

$i.math

math. The ion rendered as a math expression (element symbol with charge).

$i.metalCategory

text. The metal category of the underlying element (e.g. alkali metal, transition metal, nonmetal).

$i.name

text. The full name of the ion (e.g. "sodium ion").

$i.period

integer. The period number of the underlying element in the periodic table.

text. The chemical symbol of the element.

$i.text

text. The ion rendered as a plain text string.

$i.textColor

text. Human-readable name for this component's text color, derived from the active style and theme.

$i.textStyleDescription

text. Human-readable description of this component's text styling (color and any background color).

Common to all components (4)
$i.doenetML

text. The DoenetML source code that produced this component.

$i.hide

boolean. Whether to hide this component from the rendered output.

$i.isResponse

boolean. Whether this component is treated as a response for the purposes of assessment.

$i.styleNumber

integer. The style number used to select this component's visual styling from the available style definitions.

Examples

Example: Define an <ion> by symbol and charge

An <ion> may be specified by either its chemical symbol or its atomicNumber, together with a charge. If charge is omitted, the element’s most common ion charge is used. The name property automatically adjusts to the ion’s chemistry naming convention (e.g. oxide for O2\mathrm{O}^{2-}).


Example: Default charge uses the most common ion

When charge is not specified, <ion> uses the element’s chargeOfCommonIon as its default. For elements without a common ion (e.g. noble gases), the default charge is zero.


Example: Provide the element as an <atom> child

Instead of symbol or atomicNumber, an <ion> may take an <atom> child. This is useful when the element has already been defined elsewhere in the document.

Attribute Examples

Attribute Example: symbol

The symbol attribute takes the chemical symbol of the underlying element. The symbol is case-insensitive on input but is rendered with the canonical capitalization.


Attribute Example: atomicNumber

The atomicNumber attribute identifies the underlying element by its number of protons.


Attribute Example: charge

The charge attribute is an integer (positive for cations, negative for anions). When the underlying element supports multiple oxidation states (e.g. transition metals), the name property includes a Roman-numeral oxidation state suffix.

Property Examples

Property Example: name, charge, symbol, atomicNumber

symbol, atomicNumber, and charge echo the values used to define the ion; name is the full IUPAC-style name, including a Roman-numeral oxidation state where applicable.


Property Example: math, latex, text

math is a math expression that can be used in computations, latex is a LaTeX string suitable for rendering, and text is a plain-text fallback.


Property Example: periodic-table properties of the underlying element

The group, groupName, period, and metalCategory properties report periodic-table information about the underlying element (the same values you would get from an <atom> of that element).