AINotice¶
A display-only FormCell designed specifically for AI experiences. The notice shows an AI icon, a customizable message, and an optional hyperlink. The hyperlink can be configured to open supporting information or trigger an MDK action when selected. The tool is commonly used to provide supporting information about AI features, including guidelines, privacy information, or related policies.
AINotice does not support properties like Validation, HelperText, RequiredIndicator, or IsEditable. It is compatible with FormCellSection (SectionedTable) and is not compatible with FormCellContainer. AINotice supports both single and multi-column layouts.
Do: Use AINotice to inform users that content was generated by AI.
Don't: Do not use AINotice for non-AI-related informational messages.
Note: This control does not include any AI capabilities itself. It is a UI control that facilitates AI experiences. Developers must decide the appropriate AI scenarios.
When assigning a rule to a property of AINotice, the rule will be passed an instance of the following proxy class as an argument:
AINotice Properties¶
| Property | Type | Required | Default |
|---|---|---|---|
| HyperlinkText | string |
No | |
| IsVisible | boolean |
No | true |
| Message | string |
No | |
| OnHyperlinkPress | ActionOrRule | No | |
| Separator | boolean |
No | true |
| Styles | object |
No | |
| _Name | string |
Yes | |
| _Type | const |
Yes |
HyperlinkText¶
The text displayed as a tappable hyperlink appended inline after the message. If omitted or empty, no hyperlink is rendered.
- type:
string
IsVisible¶
Sets the visibility of the control.
-
type:
boolean -
default:
true
Message¶
The AI-generated message text that is displayed. If omitted or empty, a default localized string is shown.
- type:
string
OnHyperlinkPress¶
Action or rule to execute when the hyperlink is tapped. Only invoked when HyperlinkText is non-empty.
- type: ActionOrRule
- Formatter and Binding are not supported
Separator¶
Sets the visibility of the separator line below the control. This property will take precedence over ControlSeparator in section and is only supported for Form Cell control in Sectioned Table and not supported in Form Cell Container.
-
type:
boolean -
default:
true
Styles¶
Set styles for Background and Message via named CSS classes.
- type:
objectwith following properties.
| Property | Type | Required | Default |
|---|---|---|---|
| Background | string | No | |
| Message | string | No |
Background¶
Name of a CSS class that controls the cell background.
| CSS Property | Description |
|---|---|
background-color |
Applies a solid fill across the entire cell row. For iOS and Android, this tints the host view to eliminate white strips above or below the content. |
padding |
CSS shorthand for spacing. Accepts one value (all sides), two values (vertical and horizontal), three values (top, horizontal, and bottom), or four values (top, right, bottom, and left). |
- AINoticeBackground style class
Message¶
Name of a CSS class that controls the message text.
| CSS Property | Description |
|---|---|
font-color |
Specifies the message text color using a hex string. |
font-size |
Defines the explicit point size and overrides any size implied by font-style. |
font-typeface |
Determines weight and/or italic font styles. Accepts space-separated values. Recognized weights include: ultralight, thin, light, regular, medium, semibold, bold, heavy, black. Add italic for slanted glyphs, such as bold italic). |
text-decoration |
Includes options like underline or line-through. |
font-style |
Provides typography options: caption1, caption2, footnote, subheadline, callout, body, headline, title1, title2, title3, largeTitle, extraLargeTitle, extraLargeTitle2, KPI, largeKPI. iOS only — Android ignores font-style; use font-size to adjust text size in Android. |
The hyperlink (HyperlinkText) is always displayed in the platform's link color with bold weight. CSS changes to the Message class only affect the message text and not the hyperlink.
- AINoticeMessage style class
_Name¶
- type:
string
_Type¶
- type:
const
The value of this property must be:
"Control.Type.FormCell.AINotice"
Examples¶
{
"_Type": "Page",
"_Name": "AINoticePage",
"Caption": "AI Notice Example",
"Controls": [{
"_Type": "Control.Type.SectionedTable",
"_Name": "SectionedTable",
"Sections": [{
"Header": {
"Caption": "AI Notice Section"
},
"_Type": "Section.Type.FormCell",
"Controls": [
{
"_Type": "Control.Type.FormCell.AINotice",
"_Name": "AINoticeCell",
"Message": "This result was produced by an AI model. Verify before use.",
"HyperlinkText": "Learn more",
"OnHyperlinkPress": "/MDKApp/Rules/AINotice/OnHyperlinkPress.js",
"IsVisible": true,
"Separator": true,
"Styles": {
"Background": "AINoticeBackgroundStyle",
"Message": "AINoticeMessageStyle"
}
}
]
}]
}]
}
Style Classes Definition¶
/* AI Notice - Background
* Fills the full cell row with a green tint and 10pt padding on every side.
* Padding accepts CSS shorthand (1, 2, 3, or 4 values). */
.AINoticeBackgroundStyle {
background-color: #E8F5E9;
padding: 10;
}
/* AI Notice - Message
* Bold red text at 16pt with an underline. */
.AINoticeMessageStyle {
font-color: #D32F2F;
font-size: 16;
font-typeface: bold;
text-decoration: underline;
}
Supported CSS properties on the Message class¶
| Property | Example | iOS | Android |
|---|---|---|---|
font-color |
#D32F2F |
✓ | ✓ |
font-size |
16 |
✓ | ✓ |
font-typeface |
bold, italic, bold italic, light, regular, ... |
✓ | ✓ |
text-decoration |
underline, line-through |
✓ | ✓ |
font-style |
caption1, caption2, footnote, subheadline, callout, body, headline, title1, title2, title3, largeTitle, extraLargeTitle, extraLargeTitle2, KPI, largeKPI |
✓ | ✗ (use font-size instead) |
Supported CSS properties on the Background class¶
| Property | Example | iOS | Android |
|---|---|---|---|
background-color |
#E8F5E9 |
✓ | ✓ |
padding (1-value) |
10 (all sides) |
✓ | ✓ |
padding (2-value) |
10 16 (vertical horizontal) |
✓ | ✓ |
padding (3-value) |
16 20 8 (top horizontal bottom) |
✓ | ✓ |
padding (4-value) |
16 20 8 12 (top right bottom left) |
✓ | ✓ |
Notes on the hyperlink portion¶
The HyperlinkText always renders in the platform's link color (tint blue) and bold weight. CSS overrides on the Message class apply to the surrounding message text, not to the hyperlink span itself. This is consistent with platform link styling conventions.
OnHyperlinkPress Rule¶
// /MDKApp/Rules/AINotice/OnHyperlinkPress.js
export default function OnHyperlinkPress(context) {
// context is the AINoticeFormCellProxy
const message = context.getMessage();
console.log(`Hyperlink pressed for: ${message}`);
}
Combining styles¶
Multiple CSS properties stack within a single class:
/* Red, 20pt, bold italic, underlined. */
.AINoticeAllProps {
font-color: #D32F2F;
font-size: 20;
font-typeface: bold italic;
text-decoration: underline;
}
/* Yellow background combined with bold headline-sized text. */
.AINoticeYellowBackground { background-color: #fff3cd; padding: 10; }
.AINoticeHeadlineBold {
font-color: #1A237E;
font-style: headline; /* iOS only */
font-typeface: bold;
}
{
"_Type": "Control.Type.FormCell.AINotice",
"_Name": "ainotice_combined",
"Message": "Bold red text, underlined, on a yellow background.",
"HyperlinkText": "Learn more",
"Styles": {
"Background": "AINoticeYellowBackground",
"Message": "AINoticeAllProps"
}
}