diff --git a/src/components/panel/_macro-options.md b/src/components/panel/_macro-options.md
index 7d0b893587..0541e4cbe5 100644
--- a/src/components/panel/_macro-options.md
+++ b/src/components/panel/_macro-options.md
@@ -1,13 +1,13 @@
-| Name | Type | Required | Description |
-| ------------------- | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
-| body | string | true | The contents of the panel. This can contain HTML. |
-| title | string | false | The title for the error summary panel |
-| headingLevel | int | false | Number used to determine the heading level of the title. Use to ensure the title has a correct semantic order on the page. Defaults to `2` |
-| type | string | false | A single value to adjust the component using available variants: “success”, “warn”, “ghost”, “bare”, “error”, “branded”, “warn-branded”, and “announcement” |
-| spacious | boolean | false | Set to “true” to double the padding spacing surrounding the body content if required |
-| classes | string | false | Custom classes to add to the panel |
-| id | string | false | The HTML `id` for the panel |
-| attributes | object | false | HTML attributes to apply to the panel (for example, data attributes) |
-| assistiveTextPrefix | string | false | Sets the visually hidden prefix text for screen readers. Default values for each panel type:
- `information` and `branded` – “Important information: ”
- `success` – “Completed: ”
- `warn` and `warn-branded` – “Warning: ”
- `error`– “Error: ”
|
-| iconType | string | false | Adds an icon to the panel, before the body content, by setting the [icon type](/foundations/icons#icon-type) |
-| iconSize | string | false | Icon size can be set to match the size of the body content text as detailed in the [typography type scale](/foundations/typography/#type-scale) |
+| Name | Type | Required | Description |
+| ------------------- | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| body | string | true | The contents of the panel. This can contain HTML. |
+| title | string | false | The title for the error summary panel (not supported for the warn, warn-branded, announcement and bare panels ) |
+| headingLevel | int | false | Number used to determine the heading level of the title. Use to ensure the title has a correct semantic order on the page. Defaults to `2` |
+| variant | string | false | A single value to adjust the component using available variants: "info", “success”, “bare”, “error”, “warn”, “warn-branded”, and “announcement” |
+| spacious | boolean | false | Set to “true” to double the padding spacing surrounding the body content if required |
+| classes | string | false | Custom classes to add to the panel |
+| id | string | false | The HTML `id` for the panel |
+| attributes | object | false | HTML attributes to apply to the panel (for example, data attributes) |
+| assistiveTextPrefix | string | false | Sets the visually hidden prefix text for screen readers. Default values for each panel type: - `info` – “Important information: ”
- `success` – “Completed: ”
- `warn` and `warn-branded` – “Warning: ”
- `error`– “Error: ”
- `announcement`– “Announcement: ”
|
+| iconType | string | false | Adds an icon to the panel, before the body content, by setting the [icon type](/foundations/icons#icon-type) |
+| iconSize | string | false | Icon size can be set to match the size of the body content text as detailed in the [typography type scale](/foundations/typography/#type-scale) |
diff --git a/src/components/panel/_macro.njk b/src/components/panel/_macro.njk
index 40bd88a5fe..ff0cb9dd26 100644
--- a/src/components/panel/_macro.njk
+++ b/src/components/panel/_macro.njk
@@ -50,7 +50,7 @@
{{ params.assistiveTextPrefix | default("Announcement: ") }}
{% endif %}
- {% if params.title %}
+ {% if params.title and (params.variant not in ['bare', 'warn', 'warn-branded', 'announcement'] ) %}
{% if params.variant == 'error' %}
{% set defaultTitleTag = "h" ~ 2 %}
{% else %}
diff --git a/src/components/panel/_macro.spec.js b/src/components/panel/_macro.spec.js
index fb7c35d0db..6bf4abbc91 100644
--- a/src/components/panel/_macro.spec.js
+++ b/src/components/panel/_macro.spec.js
@@ -32,7 +32,7 @@ describe('macro: panel', () => {
expect(results).toHaveNoViolations();
});
- it('has correct class', () => {
+ it('has correct panel variant class', () => {
const $ = cheerio.load(
renderComponent('panel', {
...EXAMPLE_PANEL_BASIC,
@@ -173,6 +173,20 @@ describe('macro: panel', () => {
});
});
+ describe.each(['bare', 'warn', 'warn-branded', 'announcement'])('mode: %s', (panelVariant) => {
+ it('does not render a title when `title` is provided', () => {
+ const $ = cheerio.load(
+ renderComponent('panel', {
+ ...EXAMPLE_PANEL_BASIC,
+ title: 'Panel title',
+ variant: panelVariant,
+ }),
+ );
+
+ expect($('.ons-panel__title').length).toBe(0);
+ });
+ });
+
describe.each([
['error', 'h2'],
['success', 'div'],