Ariadne

CommentComponent

import Example from ‘../../src/@primer/gatsby-theme-doctocat/components/example’

Defines a submittable form for adding comments to a conversation.

attribute, which will be used to label the tabs for screen readers.

Accessibility

This component requires you to pass in a sr_label

Arguments

Name Type Default Description
url String N/A The URL to take action against.
method String :post The method to use when submitting the form.
sr_label String N/A A label to introduce these tabs for screen readers.
hidden_fields [String] [] An array of arrays of additional (hidden) fields to add to the form.
classes String "" Classes and attributes
attributes Hash {} Classes and attributes

Slots

Public_tab

Public_submit

Internal_tab

Internal_submit

Examples

Default


<%= render(Ariadne::CommentComponent.new(url: "/messages", method: :post, sr_label: "Select delivery time")) do |comment| %>
  <% comment.public_tab(selected: true, text: "Reply to sender") %>
  <% comment.public_submit { "Send" } %>
  <% comment.internal_tab(text: "Internal comment") %>
  <% comment.internal_submit { "Send" } %>
<% end %>

Have questions?

Still have questions? Talk to support.