<ref>

A link to a component reference or to a URL

The <ref> component renders a link to another Doenet document or to an external website.

Attributes and Properties

Attributes for <ref>

Other (3)

boolean. Default value: false. Whether to render this reference as a clickable button.

textType

text. Default value: type-global. Type of text to use for the reference label.

to

reference or text. The target that the reference points to (component reference or URL string).

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 <ref name="r">

Other (8)
$r.disabled

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

$r.fixed

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

$r.fixLocation

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

$r.hidden

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

$r.linkText

text. The display text used for the link.

$r.text

text. The text used as the link label.

$r.textType

text. Type of text to use for the reference label.

$r.url

text. The resolved URL of the referenced component.

Common to all components (4)
$r.doenetML

text. The DoenetML source code that produced this component.

$r.hide

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

$r.isResponse

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

$r.styleNumber

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

Examples

Example: <ref> to an external website

In the example above, the to attribute of the <ref> component is used with the address of an external webpage to create a link within a paragraph.

Attribute Examples

Attribute Example: createButton

The createButton attribute is used render the link in button format.