As of January 3rd, 2023 the ACCESS NYC Pattern library package is deprecated in favor of the NYC Opportunity Standard which contains updated user interface elements and usability guidance.
Share Form
The Share Form Component uses JavaScript to share a page url via SMS or email. It will post the request to the action attributed to the form for backend processing but it will not submit directly to any messaging service. The url to be shared is defined in a hidden field in the form markup.
<div class="c-share-form" data-js="share-form"> <button aria-controls="aria-c-share-form__text" aria-describedby="share-disclaimer" aria-expanded="false" class="btn btn-primary c-share-form__toggle" data-js="share-form__control disclaimer-control" data-scroll-offset="16">Text</button> <form aria-hidden="true" class="c-share-form__form hidden" id="aria-c-share-form__text" method="post"> <input name="action" type="hidden" value="sms_send" /> <input name="url" readonly="" type="hidden" value="MyURL" /> <input name="hash" readonly="" type="hidden" value="MyHash" /> <input maxlength="13" name="GUID" readonly="" type="hidden" value="MyGUID" /> <div class="c-share-form__fieldset"> <div class="c-share-form__input input-phone-us"> <input data-js="share-form__input" name="to" placeholder="Phone Number" required="true" type="tel" /> </div> <div class="c-share-form__button"> <button class="btn btn-primary btn-small" type="submit">Send</button> <div aria-hidden="true" class="c-share-form__spinner" data-js="spinner"> <svg class="spinner icon-4 text-yellow-access" version="1.1" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <circle class="spinner__path" cx="12" cy="12" fill="none" r="10"></circle> </svg> </div> <div class="c-share-form__success">Sent!</div> </div> </div> </form> </div>