diff --git a/CODE_OF_CONDUCT.html b/CODE_OF_CONDUCT.html new file mode 100644 index 0000000..8d16887 --- /dev/null +++ b/CODE_OF_CONDUCT.html @@ -0,0 +1,86 @@ + +Code of Conduct • shinyGovstyle + Skip to contents + + +
+
+
+ +
+ +

As contributors and maintainers of this project, we pledge to follow the Contributor Covenant in our interactions with others. We value an open and welcoming environment where everyone feels respected and heard.

+
+

Our Standards

+

Examples of behavior that contributes to creating a positive environment include:

+
  • Being respectful and considerate of differing viewpoints.
  • +
  • Using welcoming and inclusive language.
  • +
  • Focusing on what is best for the community.
  • +
  • Showing empathy towards other community members.
  • +

Examples of unacceptable behavior include:

+
  • Harassment, trolling, or derogatory comments.
  • +
  • Personal attacks or insults.
  • +
  • Any form of discrimination.
  • +
+
+

Our Responsibilities

+

Project maintainers are responsible for clarifying and enforcing our standards of behavior. They have the right and responsibility to remove, edit, or reject comments, commits, code, issues, and other contributions that are not aligned with this Code of Conduct.

+
+
+

Scope

+

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.

+
+
+

Enforcement

+

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team. The project team will review and address any reported issues promptly.

+
+
+

Attribution

+

This Code of Conduct is adapted from the Contributor Covenant.

+
+
+ +
+ + +
+ + + + + + + diff --git a/CONTRIBUTING.html b/CONTRIBUTING.html new file mode 100644 index 0000000..d2cde9e --- /dev/null +++ b/CONTRIBUTING.html @@ -0,0 +1,86 @@ + +Contributing to shinyGovstyle • shinyGovstyle + Skip to contents + + +
+
+
+ +
+ +

Ideas for shinyGovstyle should first be raised as a GitHub issue after which anyone is free to write the code and create a pull request for review.

+

For support and information on package development in R, we recommend using the R Packages (2e) guide by Hadley Wickham and Jennifer Bryan, this contains a wealth of information and best practice for all kinds of activities around package development in R.

+
+

Raising new changes

+

New changes should be made on a branch off of the latest version of the master branch.

+

If you don’t have access to push to the repo itself, you should start by creating a fork of the repository. You’ll then be able to make a new branch in your own repo and push your suggested changes to that.

+

Once ready, you should raise a PR in the main GitHub repository, pointing at the master branch and one of the package maintainers will be able to review your changes.

+

Once a pull request is reviewed and ready to be merged in, all commits in the PR should be squashed as a part of the merge to keep the Git history shorter and easier to navigate.

+

The master branch acts as the development version of the package for users, releases of stable package versions to CRAN will be made by the maintainers when they feel it is appropriate to do so.

+
+
+

CSS changes

+

All changes made to the main inst/www/css/govuk-frontend-norem.css file should be logged in the css_changes.md file, this way they can easily be reapplied whenever the CSS assests from GOV.UK are updated.

+

Alternatively, you can start a separate CSS file if your styling is separate to the GOV.UK styling.

+
+
+

Updating to latest GOV.UK Frontend version

+

Currently we take static precompiled exports of the GOV.UK Frontend files, and then store them in the inst/ directory. Usual steps involved:

+
  1. Locate the latest (or desired) GOV.UK Frontend version on GitHub

  2. +
  3. Download and unzip the ZIP folder, copying the assets (including fonts and images) into the inst/www/ folder

  4. +
  5. Apply any changes from css_changes.md manually, to preserve previous edits

  6. +
  7. Test all the code functions as expected using devtools::check()

  8. +
  9. Manually test the examples using shinyGovstyle::run_example(), ensuring the styling is as expected

  10. +

If unsure on the styling and expected appearance, use the GOV.UK Design System site to explore the components in more detail and official guidance for their use.

+
+
+

Code of Conduct

+

Please note that the shinyGovstyle project is released with a Contributor Code of Conduct. By contributing to this project you agree to abide by its terms.

+
+
+ +
+ + +
+ + + + + + + diff --git a/LICENSE.html b/LICENSE.html new file mode 100644 index 0000000..92fd1ad --- /dev/null +++ b/LICENSE.html @@ -0,0 +1,250 @@ + +GNU General Public License • shinyGovstyle + Skip to contents + + +
+
+
+ +
+ +

Version 3, 29 June 2007
Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>

+

Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.

+
+

Preamble

+

The GNU General Public License is a free, copyleft license for software and other kinds of works.

+

The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program–to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.

+

When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.

+

To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.

+

For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.

+

Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.

+

For the developers’ and authors’ protection, the GPL clearly explains that there is no warranty for this free software. For both users’ and authors’ sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.

+

Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users’ freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.

+

Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.

+

The precise terms and conditions for copying, distribution and modification follow.

+
+
+

TERMS AND CONDITIONS

+
+

0. Definitions

+

“This License” refers to version 3 of the GNU General Public License.

+

“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.

+

“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations.

+

To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work.

+

A “covered work” means either the unmodified Program or a work based on the Program.

+

To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.

+

To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.

+

An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.

+
+
+

1. Source Code

+

The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work.

+

A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.

+

The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.

+

The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work’s System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.

+

The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.

+

The Corresponding Source for a work in source code form is that same work.

+
+
+

2. Basic Permissions

+

All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.

+

You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.

+

Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.

+
+
+ +

No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.

+

When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work’s users, your or third parties’ legal rights to forbid circumvention of technological measures.

+
+
+

4. Conveying Verbatim Copies

+

You may convey verbatim copies of the Program’s source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.

+

You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.

+
+
+

5. Conveying Modified Source Versions

+

You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:

+
  • +a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
  • +
  • +b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”.
  • +
  • +c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
  • +
  • +d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
  • +

A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation’s users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.

+
+
+

6. Conveying Non-Source Forms

+

You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:

+
  • +a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
  • +
  • +b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
  • +
  • +c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
  • +
  • +d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
  • +
  • +e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
  • +

A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.

+

A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.

+

“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.

+

If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).

+

The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.

+

Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.

+
+
+

7. Additional Terms

+

“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.

+

When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.

+

Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:

+
  • +a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
  • +
  • +b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
  • +
  • +c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
  • +
  • +d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
  • +
  • +e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
  • +
  • +f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
  • +

All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.

+

If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.

+

Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.

+
+
+

8. Termination

+

You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).

+

However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.

+

Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.

+

Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.

+
+
+

9. Acceptance Not Required for Having Copies

+

You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.

+
+
+

10. Automatic Licensing of Downstream Recipients

+

Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.

+

An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party’s predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.

+

You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.

+
+
+

11. Patents

+

A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor’s “contributor version”.

+

A contributor’s “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.

+

Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor’s essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.

+

In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.

+

If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient’s use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.

+

If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.

+

A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.

+

Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.

+
+
+

12. No Surrender of Others’ Freedom

+

If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.

+
+
+

13. Use with the GNU Affero General Public License

+

Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.

+
+
+

14. Revised Versions of this License

+

The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.

+

Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.

+

If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy’s public statement of acceptance of a version permanently authorizes you to choose that version for the Program.

+

Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.

+
+
+

15. Disclaimer of Warranty

+

THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

+
+
+

16. Limitation of Liability

+

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

+
+
+

17. Interpretation of Sections 15 and 16

+

If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.

+

END OF TERMS AND CONDITIONS

+
+
+
+

How to Apply These Terms to Your New Programs

+

If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.

+

To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.

+
<one line to give the program's name and a brief idea of what it does.>
+Copyright (C) <year>  <name of author>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+

Also add information on how to contact you by electronic and paper mail.

+

If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:

+
<program>  Copyright (C) <year>  <name of author>
+This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type 'show c' for details.
+

The hypothetical commands show w and show c should show the appropriate parts of the General Public License. Of course, your program’s commands might be different; for a GUI interface, you would use an “about box”.

+

You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <http://www.gnu.org/licenses/>.

+

The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <http://www.gnu.org/philosophy/why-not-lgpl.html>.

+
+
+ +
+ + +
+ + + + + + + diff --git a/PULL_REQUEST_TEMPLATE.html b/PULL_REQUEST_TEMPLATE.html new file mode 100644 index 0000000..7940e77 --- /dev/null +++ b/PULL_REQUEST_TEMPLATE.html @@ -0,0 +1,72 @@ + +NA • shinyGovstyle + Skip to contents + + +
+
+
+ + +
+

Overview of changes

+ + + +
+
+

PR Checklist

+
  • +
  • +
  • +
+
+

Reviewer instructions

+ +
+ + +
+ + +
+ + + + + + + diff --git a/index.html b/index.html index 57dba98..eb3c3d2 100644 --- a/index.html +++ b/index.html @@ -66,23 +66,37 @@

Overview

-

This package provides some custom widgets to style your app like gov.uk. There are a variety of widgets available, including select, radio, checkboxes as well as styling for headers and footers.

-

To view details of gov.uk components please visit https://design-system.service.gov.uk/. Most components from https://design-system.service.gov.uk/components/ are available to use through this package.

-

Installation :

+

This package provides custom widgets to style R Shiny apps using the GOV.UK design system.

+

To view details and advice on how to use the GOV.UK components please visit https://design-system.service.gov.uk/components/, most components should be available to use through this package.

+
+

Installation +

+

You can install the latest stable version from CRAN

 install.packages("shinyGovstyle")
+

If you want to make use of the development version then install directly from GitHub.

+
+remotes::install_github("moj-analytical-services/shinyGovstyle")

This is also available on conda

conda install r-shinygovstyle
-

If you want to make use of the development then

-
-remotes::install_github("moj-analytical-services/shinyGovstyle")
-

To use error and word count elements you will need to load useShinyjs from shinyjs in the UI:

+

To use error and word count elements you will need to load useShinyjs from shinyjs in your ui.R file

   shinyjs::useShinyjs()
-
-

Components available : -

+
+

Contributing +

+

Ideas, bug reports, and requests for new components should be raised as GitHub issue. It’s often worth checking the existing issues log incase there is already an existing discussion you can conrtibute to.

+

More details on contributing can be found in the CONTRIBUTING.md file.

+

This package is also released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

+
+
+

Available components +

+

The package contains an example dashboard you can run yourself, showcasing available components

+
+shinyGovstyle::run_example()
+

Full list of available components:

-
-

Gov style layout -

+
+

Gov style layout +

Create a gov style look to the page with a header, footer, font and layout:
gov-style-layout

-
+
 ui <- fluidPage(
   #font(),
   shinyGovstyle::header("Justice", "Prototype", logo="shinyGovstyle/images/moj_logo.png"),
@@ -133,11 +146,11 @@ 

Gov style layoutserver <- function(input, output, session) {}

Note: You can only use gov.uk font on service.gov.uk (see https://design-system.service.gov.uk/styles/typography/)

-
- +
+

Add a banner to the header to state in beta or alpha :
banner

-
+
 ui <- fluidPage(
   shinyGovstyle::header("Justice", "Prototype", logo="shinyGovstyle/images/moj_logo.png"),
   banner("banner", "beta", 'This is a new service – your <a class="govuk-link" href="#">feedback</a> will help us to improve it.'),
@@ -153,9 +166,9 @@ 
-
- +
+

Create contents and subcontents links to sidebar to navigate page.

Important: contents_link() requires the following UI structure to enable the js to work as it relies on the IDs for each section to then point a users focus to. This can also be found in run_example():

@@ -268,9 +281,9 @@
-
-

Heading text -

+
+

Heading text +

Use heading text to create headings.

You can adjust the text size by setting size to ‘xl’, ‘l’, ‘m’, or ‘s’. size defaults to ‘xl’.

@@ -281,20 +294,20 @@

Heading textshinyGovstyle::contents_link. This can be helpful when you have identically named headings.

heading_text(text_input = "I am the default extra large text", id = "custom_id")

-
-

Radio button -

+
+

Radio button +

Create a gov style radio button :
radio_button

-
+
 radio_button_Input(inputId = "name_changed", label = "Have you changed your name?",
                    choices= c("Yes", "No"), inline = TRUE,
                    hint_label = "This includes changing your last name or spelling your name differently.")
-
-

Checkbox -

+
+

Checkbox +

Turn checkboxes into gov style ones :
checkbox

-
+
 checkbox_Input(
   inputId = "checkID", 
   cb_labels = c("Waste from animal carcasses", "Waste from mines or quarries", "Farm or agricultural waste"),
@@ -303,62 +316,62 @@ 

Checkbox hint_label = "Select all that apply.")

Note that you currently access the values separately through the inputIds you supply or all values through the main inputID.

-
-

Button -

+
+

Button +

Gov style button with different styles : button

-
shinyGovstyle::button_Input(inputId = "btn1", label = "default"),
-shinyGovstyle::button_Input(inputId = "btn1", label = "start", type = "start"),
-shinyGovstyle::button_Input(inputId = "btn1", label = "secondary", type = "secondary"),
-shinyGovstyle::button_Input(inputId = "btn1", label = "warning", type = "warning")
-
-
-

Select -

+
shinyGovstyle::button_Input(inputId = "btn1", label = "default"),
+shinyGovstyle::button_Input(inputId = "btn1", label = "start", type = "start"),
+shinyGovstyle::button_Input(inputId = "btn1", label = "secondary", type = "secondary"),
+shinyGovstyle::button_Input(inputId = "btn1", label = "warning", type = "warning")
+
+
+

Select +

Gov style drop down select : select

-
+
 shinyGovstyle::select_Input(
   inputId = "sorter", 
   label = "Sort by",
   select_text = c("Recently published", "Recently updated", "Most views", "Most comments"),
   select_value = c("published", "updated", "view", "comments"))
-
-

Date -

-

Gov style date input : date

-
+
+

Date +

+

Gov style date input date

+
 date_Input(
   inputId = "date1",
   label = "What is your date of birth?",
   hint_label = "For example, 31 3 1980")

Note that you currently access the individual values by adding an affix of _day, _month and _year or the full date in dd/mm/yy by using the inputID.

-
-

File input -

-

Gov style file input component : file_input

-
+
+

File input +

+

Gov style file input component file_input

+
 file_Input(inputId = "file1", label = "Upload a file")
-
-

Text input -

-

Gov style text input component : text_input

-
+
+

Text input +

+

Gov style text input component text_input

+
 text_Input(inputId = "txt1", label = "Event name")
-
-

Text area input -

-

Gov style text area input component : text_area

-
+
+

Text area input +

+

Gov style text area input component text_area

+
 text_area_Input(
   inputId = "text_area",
   label = "Can you provide more detail?",
   hint_label = "Do not include personal or financial information, like your National Insurance number or credit card details.")

You can also add a word count to the options, which requires an additional argument in the server : text_area

-
+
 ui <- fluidPage(
   shinyjs::useShinyjs(),
   shinyGovstyle::header("Justice", "", logo="shinyGovstyle/images/moj_logo.png"),
@@ -380,27 +393,27 @@ 

Text area input ) }

-
-

Warning -

-

Gov style warning component : text_area

-
+
+

Warning +

+

Gov style warning component text_area

+
 warning_text(inputId = "warn", text = "You can be fined up to £5,000 if you do not register.")
-
-

Insert text -

-

Gov style insert text component : text_area

-
+
+

Insert text +

+

Gov style insert text component text_area

+
 insert_text(inputId = "insertId",
             text = "It can take up to 8 weeks to register a lasting power of attorney 
                     if there are no mistakes in the application.")
-
-

Value box -

-

Gov style value box component : value_box

-
+
+

Value box +

+

Gov style value box component value_box

+
 value_text(
   inputId = "valueId",
   value = "1,000,000",
@@ -408,11 +421,11 @@ 

Value box= "purple" )

-
-

Details -

-

Gov style details component : details

-
+
+

Details +

+

Gov style details component details

+
-
-

Panel -

-

Gov style panel component : panel

-
+
+

Panel +

+

Gov style panel component panel

+
 panel_output(
   inputId = "panId", 
   main_text = "Application complete", 
   sub_text = "Your reference number <br> <strong>HDJ2123F</strong>")
-
-

Notification Banner -

-

Gov style panel component : Notification Banner

-
noti_banner(
-  "notId",
-  title_txt = "Important",
-  body_txt = Example text,
-  type = "standard"
-)
-
-
-

Accordion -

-

Gov style accordion component : Accordion

-
+
+

Notification Banner +

+

Gov style panel component Notification Banner

+
noti_banner(
+  "notId",
+  title_txt = "Important",
+  body_txt = Example text,
+  type = "standard"
+)
+
+
+

Accordion +

+

Gov style accordion component Accordion

+
 accordion(
       "acc1",
       c("Writing well for the web",
@@ -459,11 +472,11 @@ 

Accordion"This is the content for How people read." ))

-
-

Table -

-

Gov style table component : Table

-
+
+

Table +

+

Gov style table component Table

+
 Months <- c("January", "February", "March")
 Bikes <- c("£85", "£75", "£165")
 Cars <- c("£95", "£55", "£125")
@@ -473,11 +486,11 @@ 

Table "tab1", example_data, "Test", "l", num_col = c(2,3), width_overwrite = c("one-half", "one-quarter", "one-quarter"))

-
-

Tabs -

-

Gov style tabs component : Tabs

-
+
+

Tabs +

+

Gov style tabs component Tabs

+
   # Create an example dataset
   tabs <- c(rep("Past Day", 3),
             rep("Past Week", 3),
@@ -501,11 +514,11 @@ 

Tabs server <- function(input, output, session) {} shinyApp(ui = ui, server = server)

-
-

Summary List -

-

Gov style summary list : Summary List

-
+
+

Summary List +

+

Gov style summary list Summary List

+
   # Create an example dataset
   headers <- c("Name", "Date of birth", "Contact information", "Contact details")
   info <- c(
@@ -527,11 +540,11 @@ 

Summary Listserver <- function(input, output, session) {} shinyApp(ui = ui, server = server)

-
- -

Gov style cookie banner : Cookie Banner

-
+
+ +

Gov style cookie banner Cookie Banner

+
 ui <- fluidPage(
   shinyGovstyle::header(
     main_text = "Example",
@@ -573,9 +586,9 @@ 
-
-

Skip to main -

+
+

Skip to main +

Add an accessible ‘Skip to main content’ link which is typically used by keyboard-only users to bypass content and navigate directly to the main content of a page. It is only visible to users ‘tabbing’ over the feature, otherwise it is hidden:

Important: your main column will need an id of “main_col” for this to work

@@ -628,27 +641,27 @@

Skip to main} shinyApp(ui = ui, server = server)

-
-

Tags -

-

Add a gov style tag component : tags

-
tag_Input(inputId = "tag1", text = "Default"),
-tag_Input(inputId = "tag2", text = "Grey", colour = "grey"),
-tag_Input(inputId = "tag3", text = "Green", colour = "green"),
-tag_Input(inputId = "tag4", text = "Turquoise", colour = "turquoise"),
-tag_Input(inputId = "tag5", text = "Blue", colour = "blue"),
-tag_Input(inputId = "tag6", text = "Light-blue", colour = "light-blue"),
-tag_Input(inputId = "tag7", text = "Purple", colour = "purple"),
-tag_Input(inputId = "tag8", text = "Pink", colour = "pink"),
-tag_Input(inputId = "tag9", text = "Red", colour = "red"),
-tag_Input(inputId = "tag10", text = "Orange", colour = "orange"),
-tag_Input(inputId = "tag11", text = "Yellow", colour = "yellow")
-
-
-

Error -

-

Add errors to components when not filled in correctly. Most components have an option to add : error

-
+
+

Tags +

+

Add a gov style tag component tags

+
tag_Input(inputId = "tag1", text = "Default"),
+tag_Input(inputId = "tag2", text = "Grey", colour = "grey"),
+tag_Input(inputId = "tag3", text = "Green", colour = "green"),
+tag_Input(inputId = "tag4", text = "Turquoise", colour = "turquoise"),
+tag_Input(inputId = "tag5", text = "Blue", colour = "blue"),
+tag_Input(inputId = "tag6", text = "Light-blue", colour = "light-blue"),
+tag_Input(inputId = "tag7", text = "Purple", colour = "purple"),
+tag_Input(inputId = "tag8", text = "Pink", colour = "pink"),
+tag_Input(inputId = "tag9", text = "Red", colour = "red"),
+tag_Input(inputId = "tag10", text = "Orange", colour = "orange"),
+tag_Input(inputId = "tag11", text = "Yellow", colour = "yellow")
+
+
+

Errors +

+

Add errors to components when not filled in correctly. Most input components have this as an option to add error

+
 ui <- fluidPage(
   shinyjs::useShinyjs(),
   shinyGovstyle::header("Justice", "", logo="shinyGovstyle/images/moj_logo.png"),
@@ -679,12 +692,6 @@ 

Error ) }

-
-

Example Version -

-

You can run an example dashboard. This is very rough and will be improved. example

-
@@ -700,10 +707,18 @@

Links

License

+

Citation

diff --git a/pkgdown.yml b/pkgdown.yml index 41819a4..9632c52 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -2,4 +2,4 @@ pandoc: 3.1.11 pkgdown: 2.1.1 pkgdown_sha: ~ articles: {} -last_built: 2024-12-02T14:01Z +last_built: 2024-12-05T17:31Z diff --git a/search.json b/search.json index 0052449..e0342da 100644 --- a/search.json +++ b/search.json @@ -1 +1 @@ -[{"path":"/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Ross Wyatt. Author, maintainer. Cameron Race. Contributor. Sarah Wong. Contributor. Richard Bielby. Contributor. Charlotte Foster. Contributor. Jeni Martin. Contributor.","code":""},{"path":"/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Wyatt R (2024). shinyGovstyle: Custom Gov Style Inputs Shiny. R package version 0.1.0.9000, https://github.com/moj-analytical-services/shinyGovstyle.","code":"@Manual{, title = {shinyGovstyle: Custom Gov Style Inputs for Shiny}, author = {Ross Wyatt}, year = {2024}, note = {R package version 0.1.0.9000}, url = {https://github.com/moj-analytical-services/shinyGovstyle}, }"},{"path":"/index.html","id":"shinygovstyle-","dir":"","previous_headings":"","what":"Custom Gov Style Inputs for Shiny","title":"Custom Gov Style Inputs for Shiny","text":"Apply Gov styled components formats shiny","code":""},{"path":"/index.html","id":"overview","dir":"","previous_headings":"","what":"Overview","title":"Custom Gov Style Inputs for Shiny","text":"package provides custom widgets style app like gov.uk. variety widgets available, including select, radio, checkboxes well styling headers footers. view details gov.uk components please visit https://design-system.service.gov.uk/. components https://design-system.service.gov.uk/components/ available use package. Installation : also available conda want make use development use error word count elements need load useShinyjs shinyjs UI:","code":"install.packages(\"shinyGovstyle\") conda install r-shinygovstyle remotes::install_github(\"moj-analytical-services/shinyGovstyle\") shinyjs::useShinyjs()"},{"path":"/index.html","id":"components-available-","dir":"","previous_headings":"","what":"Components available :","title":"Custom Gov Style Inputs for Shiny","text":"Gov style layout Banner Contents links Header text Radio button Checkbox Button Select Date File input Text input Text area input Warning Insert text Value box Details Panel Notification Banner Accordion Table Tabs Summary List Cookie Banner Skip main Tags Error Example Version","code":""},{"path":"/index.html","id":"gov-style-layout","dir":"","previous_headings":"Components available :","what":"Gov style layout","title":"Custom Gov Style Inputs for Shiny","text":"Create gov style look page header, footer, font layout: Note: can use gov.uk font service.gov.uk (see https://design-system.service.gov.uk/styles/typography/)","code":"ui <- fluidPage( #font(), shinyGovstyle::header(\"Justice\", \"Prototype\", logo=\"shinyGovstyle/images/moj_logo.png\"), gov_layout(size = \"full\", tags$br(), tags$br(), tags$br(), tags$br(), tags$br() ), footer(TRUE) ) server <- function(input, output, session) {}"},{"path":"/index.html","id":"banner","dir":"","previous_headings":"Components available :","what":"Banner","title":"Custom Gov Style Inputs for Shiny","text":"Add banner header state beta alpha :","code":"ui <- fluidPage( shinyGovstyle::header(\"Justice\", \"Prototype\", logo=\"shinyGovstyle/images/moj_logo.png\"), banner(\"banner\", \"beta\", 'This is a new service – your feedback<\/a> will help us to improve it.'), gov_layout(size = \"full\", tags$br(), tags$br(), tags$br(), tags$br(), tags$br() ), footer(TRUE) ) server <- function(input, output, session) {}"},{"path":"/index.html","id":"contents-links","dir":"","previous_headings":"Components available :","what":"Contents links","title":"Custom Gov Style Inputs for Shiny","text":"Create contents subcontents links sidebar navigate page. Important: contents_link() requires following UI structure enable js work relies IDs section point users focus . can also found run_example(): can create content links without subcontents links: subcontents links: use subcontents_text_list without specifying subcontents_id_list subcontents links automatically link shinyGovstyle::heading_text() elements header label matches subcontents_text_list label. Use subcontents_id_list link subcontents link shinyGovstyle::heading_text() custom id argument. order needs match subcontents_text_list. Add NA vector subcontents links still want use automatic link id . Contents links need shiny::observeEvent() server switch tabset panels. Subcontents links work automatically need shiny::observeEvent() server.","code":"shiny::fluidpage( shinygovstyle::header( main_text = \"example\", secondary_text = \"user examples\", logo = \"shinygovstyle/images/moj_logo.png\" ), gov_row( shiny::column( width = 3, id = \"nav\", # DO NOT REMOVE ID shiny::tags$div( id = \"govuk-contents-box\", # DO NOT REMOVE ID class = \"govuk-contents-box\", # DO NOT REMOVE CLASS shiny::tags$h2(\"contents\"), # CONTENTS LINKS GO HERE ) ), shiny::column( width = 9, id = \"main-col\", # DO NOT REMOVE ID shiny::tabsetpanel( type = \"hidden\", id = \"tab-container\", # DO NOT REMOVE ID # TAB PANELS GO HERE ) ) ) ) contents_link( link_text = \"Cookies\", input_id = \"cookies_button\") contents_link( link_text = \"Feedback types\", input_id = \"feedback_types_button\", subcontents_text_list = c(\"tag_Input\", \"details\")) contents_link( link_text = \"Tables, tabs and accordions\", input_id = \"tables_tabs_and_accordions_button\", subcontents_text_list = c(\"govTable\", \"govTabs\", \"button_Input\"), subcontents_id_list = c(NA, NA, \"button_input_tables_tabs_accordions\") ) ui <- shiny::fluidPage( shinyGovstyle::header( main_text = \"Example\", secondary_text = \"User Examples\", logo = \"shinyGovstyle/images/moj_logo.png\" ), gov_row( shiny::column( width = 3, id = \"nav\", # DO NOT REMOVE ID shiny::tags$div( # DO NOT REMOVE DIV shiny::tags$h2(\"Contents\"), contents_link( \"Tables, tabs and accordions\", \"tables_tabs_and_accordions_button\", ), contents_link(\"Feedback types\", \"feedback_types_button\"), ) ), shiny::column( width = 9, id = \"main_col\", # DO NOT REMOVE ID shiny::tabsetPanel( type = \"hidden\", id = \"tab-container\", # DO NOT REMOVE ID shiny::tabPanel( \"Tables, tabs and accordions\", value = \"tables_tabs_and_accordions\", gov_layout(size = \"Tables, tabs and accordions\", heading_text(\"Tables, tabs and accordions\", size = \"l\")) ), shiny::tabPanel( \"Feedback Types\", value = \"feedback_types\", gov_layout(size = \"two-thirds\", heading_text(\"Feedback types\", size = \"l\")) ), ) ) ) ) server <- function(input, output, session) { shiny::observeEvent(input$tables_tabs_and_accordions_button, { shiny::updateTabsetPanel(session, \"tab-container\", selected = \"tables_tabs_and_accordions\") }) shiny::observeEvent(input$feedback_types_button, { shiny::updateTabsetPanel(session, \"tab-container\", selected = \"feedback_types\") }) } shiny::shinyApp(ui = ui, server = server) }"},{"path":"/index.html","id":"heading-text","dir":"","previous_headings":"Components available :","what":"Heading text","title":"Custom Gov Style Inputs for Shiny","text":"Use heading text create headings. can adjust text size setting size ‘xl’, ‘l’, ‘m’, ‘s’. size defaults ‘xl’. can use id create custom id link subcontents_id_list shinyGovstyle::contents_link. can helpful identically named headings.","code":"heading_text(text_input = \"I am the default extra large text\", size = \"xl\"), heading_text(text_input = \"I am large text\", size = \"l\"), heading_text(text_input = \"I am medium text\", size = \"m\"), heading_text(text_input = \"I am small text\", size = \"s\") heading_text(text_input = \"I am the default extra large text\", id = \"custom_id\")"},{"path":"/index.html","id":"radio-button","dir":"","previous_headings":"Components available :","what":"Radio button","title":"Custom Gov Style Inputs for Shiny","text":"Create gov style radio button :","code":"radio_button_Input(inputId = \"name_changed\", label = \"Have you changed your name?\", choices= c(\"Yes\", \"No\"), inline = TRUE, hint_label = \"This includes changing your last name or spelling your name differently.\")"},{"path":"/index.html","id":"checkbox","dir":"","previous_headings":"Components available :","what":"Checkbox","title":"Custom Gov Style Inputs for Shiny","text":"Turn checkboxes gov style ones : Note currently access values separately inputIds supply values main inputID.","code":"checkbox_Input( inputId = \"checkID\", cb_labels = c(\"Waste from animal carcasses\", \"Waste from mines or quarries\", \"Farm or agricultural waste\"), checkboxIds = c(\"op1\", \"op2\", \"op3\"), label = \"Which types of waste do you transport?\", hint_label = \"Select all that apply.\")"},{"path":"/index.html","id":"button","dir":"","previous_headings":"Components available :","what":"Button","title":"Custom Gov Style Inputs for Shiny","text":"Gov style button different styles :","code":"shinyGovstyle::button_Input(inputId = \"btn1\", label = \"default\"), shinyGovstyle::button_Input(inputId = \"btn1\", label = \"start\", type = \"start\"), shinyGovstyle::button_Input(inputId = \"btn1\", label = \"secondary\", type = \"secondary\"), shinyGovstyle::button_Input(inputId = \"btn1\", label = \"warning\", type = \"warning\")"},{"path":"/index.html","id":"select","dir":"","previous_headings":"Components available :","what":"Select","title":"Custom Gov Style Inputs for Shiny","text":"Gov style drop select :","code":"shinyGovstyle::select_Input( inputId = \"sorter\", label = \"Sort by\", select_text = c(\"Recently published\", \"Recently updated\", \"Most views\", \"Most comments\"), select_value = c(\"published\", \"updated\", \"view\", \"comments\"))"},{"path":"/index.html","id":"date","dir":"","previous_headings":"Components available :","what":"Date","title":"Custom Gov Style Inputs for Shiny","text":"Gov style date input : Note currently access individual values adding affix _day, _month _year full date dd/mm/yy using inputID.","code":"date_Input( inputId = \"date1\", label = \"What is your date of birth?\", hint_label = \"For example, 31 3 1980\")"},{"path":"/index.html","id":"file-input","dir":"","previous_headings":"Components available :","what":"File input","title":"Custom Gov Style Inputs for Shiny","text":"Gov style file input component :","code":"file_Input(inputId = \"file1\", label = \"Upload a file\")"},{"path":"/index.html","id":"text-input","dir":"","previous_headings":"Components available :","what":"Text input","title":"Custom Gov Style Inputs for Shiny","text":"Gov style text input component :","code":"text_Input(inputId = \"txt1\", label = \"Event name\")"},{"path":"/index.html","id":"text-area-input","dir":"","previous_headings":"Components available :","what":"Text area input","title":"Custom Gov Style Inputs for Shiny","text":"Gov style text area input component : can also add word count options, requires additional argument server :","code":"text_area_Input( inputId = \"text_area\", label = \"Can you provide more detail?\", hint_label = \"Do not include personal or financial information, like your National Insurance number or credit card details.\") ui <- fluidPage( shinyjs::useShinyjs(), shinyGovstyle::header(\"Justice\", \"\", logo=\"shinyGovstyle/images/moj_logo.png\"), gov_layout(size = \"full\", text_area_Input( inputId = \"text_area\", label = \"Can you provide more detail?\", hint_label = \"Do not include personal or financial information, like your National Insurance number or credit card details.\", word_limit = 300) ), footer(TRUE) ) # Define server logic required to draw a histogram server <- function(input, output, session) { observeEvent(input$text_area, word_count(inputId = \"text_area\", input = input$text_area, word_limit = 300) ) }"},{"path":"/index.html","id":"warning","dir":"","previous_headings":"Components available :","what":"Warning","title":"Custom Gov Style Inputs for Shiny","text":"Gov style warning component :","code":"warning_text(inputId = \"warn\", text = \"You can be fined up to £5,000 if you do not register.\")"},{"path":"/index.html","id":"insert-text","dir":"","previous_headings":"Components available :","what":"Insert text","title":"Custom Gov Style Inputs for Shiny","text":"Gov style insert text component :","code":"insert_text(inputId = \"insertId\", text = \"It can take up to 8 weeks to register a lasting power of attorney if there are no mistakes in the application.\")"},{"path":"/index.html","id":"value-box","dir":"","previous_headings":"Components available :","what":"Value box","title":"Custom Gov Style Inputs for Shiny","text":"Gov style value box component :","code":"value_text( inputId = \"valueId\", value = \"1,000,000\", text = \"This is the latest value for the selected inputs.\", colour = \"purple\" )"},{"path":"/index.html","id":"details","dir":"","previous_headings":"Components available :","what":"Details","title":"Custom Gov Style Inputs for Shiny","text":"Gov style details component :","code":"details( inputId = \"detID\", label = \"Help with nationality\", help_text = \"We need to know your nationality so we can work out which elections you’re entitled to vote in. If you cannot provide your nationality, you’ll have to send copies of identity documents through the post.\")"},{"path":"/index.html","id":"panel","dir":"","previous_headings":"Components available :","what":"Panel","title":"Custom Gov Style Inputs for Shiny","text":"Gov style panel component :","code":"panel_output( inputId = \"panId\", main_text = \"Application complete\", sub_text = \"Your reference number
HDJ2123F<\/strong>\")"},{"path":"/index.html","id":"notification-banner","dir":"","previous_headings":"Components available :","what":"Notification Banner","title":"Custom Gov Style Inputs for Shiny","text":"Gov style panel component :","code":"noti_banner( \"notId\", title_txt = \"Important\", body_txt = Example text, type = \"standard\" )"},{"path":"/index.html","id":"accordion","dir":"","previous_headings":"Components available :","what":"Accordion","title":"Custom Gov Style Inputs for Shiny","text":"Gov style accordion component :","code":"accordion( \"acc1\", c(\"Writing well for the web\", \"Writing well for specialists\", \"Know your audience\", \"How people read\" ), c(\"This is the content for Writing well for the web.\", \"This is the content for Writing well for specialists.\", \"This is the content for Know your audience.\", \"This is the content for How people read.\" ))"},{"path":"/index.html","id":"table","dir":"","previous_headings":"Components available :","what":"Table","title":"Custom Gov Style Inputs for Shiny","text":"Gov style table component :","code":"Months <- c(\"January\", \"February\", \"March\") Bikes <- c(\"£85\", \"£75\", \"£165\") Cars <- c(\"£95\", \"£55\", \"£125\") example_data <- data.frame(Months, Bikes, Cars) shinyGovstyle::govTable( \"tab1\", example_data, \"Test\", \"l\", num_col = c(2,3), width_overwrite = c(\"one-half\", \"one-quarter\", \"one-quarter\"))"},{"path":"/index.html","id":"tabs","dir":"","previous_headings":"Components available :","what":"Tabs","title":"Custom Gov Style Inputs for Shiny","text":"Gov style tabs component :","code":"# Create an example dataset tabs <- c(rep(\"Past Day\", 3), rep(\"Past Week\", 3), rep(\"Past Month\", 3), rep(\"Past Year\", 3)) Case_manager <- rep(c(\"David Francis\", \"Paul Farmer\", \"Rita Patel\"),4) Cases_open <- c(3, 1, 2, 24, 16, 24, 98, 122, 126, 1380, 1129, 1539) Cases_closed <- c(0, 0, 0, 18, 20, 27, 95, 131, 142, 1472, 1083, 1265) data <- data.frame(tabs, Case_manager, Cases_open, Cases_closed) ui <- fluidPage( shinyGovstyle::header( main_text = \"Example\", secondary_text = \"User Examples\", logo=\"shinyGovstyle/images/moj_logo.png\"), shinyGovstyle::gov_layout(size = \"two-thirds\", shinyGovstyle::govTabs(\"tabsID\", data, \"tabs\")), shinyGovstyle::footer(full = TRUE) ) server <- function(input, output, session) {} shinyApp(ui = ui, server = server)"},{"path":"/index.html","id":"summary-list","dir":"","previous_headings":"Components available :","what":"Summary List","title":"Custom Gov Style Inputs for Shiny","text":"Gov style summary list :","code":"# Create an example dataset headers <- c(\"Name\", \"Date of birth\", \"Contact information\", \"Contact details\") info <- c( \"Sarah Philips\", \"5 January 1978\", \"72 Guild Street
London
SE23 6FH\", \"07700 900457
sarah.phillips@example.com\") ui <- fluidPage( shinyGovstyle::header( main_text = \"Example\", secondary_text = \"User Examples\", logo=\"shinyGovstyle/images/moj_logo.png\"), shinyGovstyle::gov_layout(size = \"two-thirds\", shinyGovstyle::gov_summary(\"sumID\", headers, info, action = TRUE)), shinyGovstyle::footer(full = TRUE) ) server <- function(input, output, session) {} shinyApp(ui = ui, server = server)"},{"path":"/index.html","id":"cookie-banner","dir":"","previous_headings":"Components available :","what":"Cookie Banner","title":"Custom Gov Style Inputs for Shiny","text":"Gov style cookie banner :","code":"ui <- fluidPage( shinyGovstyle::header( main_text = \"Example\", secondary_text = \"User Examples\", logo=\"shinyGovstyle/images/moj_logo.png\"), #Needs shinyjs to work shinyjs::useShinyjs(), shinyGovstyle::cookieBanner(\"The best thing\"), shinyGovstyle::gov_layout(size = \"two-thirds\"), shinyGovstyle::footer(full = TRUE) ) server <- function(input, output, session) { #Need these set of observeEvent to create a path through the cookie banner observeEvent(input$cookieAccept, { shinyjs::show(id = \"cookieAcceptDiv\") shinyjs::hide(id = \"cookieMain\") }) observeEvent(input$cookieReject, { shinyjs::show(id = \"cookieRejectDiv\") shinyjs::hide(id = \"cookieMain\") }) observeEvent(input$hideAccept, { shinyjs::toggle(id = \"cookieDiv\") }) observeEvent(input$hideReject, { shinyjs::toggle(id = \"cookieDiv\") }) observeEvent(input$cookieLink, { #Need to link here to where further info is located. You can #updateTabsetPanel to have a cookie page for instance }) } shinyApp(ui = ui, server = server)"},{"path":"/index.html","id":"skip-to-main","dir":"","previous_headings":"Components available :","what":"Skip to main","title":"Custom Gov Style Inputs for Shiny","text":"Add accessible ‘Skip main content’ link typically used keyboard-users bypass content navigate directly main content page. visible users ‘tabbing’ feature, otherwise hidden: Important: main column need id “main_col” work feature generally positioned cookie banner header. See example :","code":"ui <- fluidPage( cookieBanner(\"Run Example\"), skip_to_main(), shinyGovstyle::header( main_text = \"Example\", secondary_text = \"User Examples\", logo=\"shinyGovstyle/images/moj_logo.png\" ), shinyjs::useShinyjs(), # shinyjs is needed to manage visibility of elements gov_row( shiny::column( width = 3, id = \"nav\", # Contents box shiny::tags$div( id = \"govuk-contents-box\", #DO NOT REMOVE ID class = \"govuk-contents-box\", #DO NOT REMOVE CLASS shiny::tags$h2(\"Contents\"), p(\"Your contents links go here\"), ) ), shiny::column( width = 9, id = \"main_col\", shiny::tabsetPanel( type = \"hidden\", id = \"tab-container\", # DO NOT REMOVE ID shiny::tabPanel( \"Your main content\", value = \"your_main_content\", gov_layout( size = \"two-thirds\", heading_text(\"Your main content\", size = \"l\"), p(\"Your main content goes here\") ) ) ) ) ) ) server <- function(input, output, session){ } shinyApp(ui = ui, server = server)"},{"path":"/index.html","id":"tags","dir":"","previous_headings":"Components available :","what":"Tags","title":"Custom Gov Style Inputs for Shiny","text":"Add gov style tag component :","code":"tag_Input(inputId = \"tag1\", text = \"Default\"), tag_Input(inputId = \"tag2\", text = \"Grey\", colour = \"grey\"), tag_Input(inputId = \"tag3\", text = \"Green\", colour = \"green\"), tag_Input(inputId = \"tag4\", text = \"Turquoise\", colour = \"turquoise\"), tag_Input(inputId = \"tag5\", text = \"Blue\", colour = \"blue\"), tag_Input(inputId = \"tag6\", text = \"Light-blue\", colour = \"light-blue\"), tag_Input(inputId = \"tag7\", text = \"Purple\", colour = \"purple\"), tag_Input(inputId = \"tag8\", text = \"Pink\", colour = \"pink\"), tag_Input(inputId = \"tag9\", text = \"Red\", colour = \"red\"), tag_Input(inputId = \"tag10\", text = \"Orange\", colour = \"orange\"), tag_Input(inputId = \"tag11\", text = \"Yellow\", colour = \"yellow\")"},{"path":"/index.html","id":"error","dir":"","previous_headings":"Components available :","what":"Error","title":"Custom Gov Style Inputs for Shiny","text":"Add errors components filled correctly. components option add :","code":"ui <- fluidPage( shinyjs::useShinyjs(), shinyGovstyle::header(\"Justice\", \"\", logo=\"shinyGovstyle/images/moj_logo.png\"), gov_layout(size = \"full\", text_area_Input( \"text_area\", \"Can you provide more detail?\", \"Do not include personal or financial information, like your National Insurance number or credit card details.\", word_limit = 300, error = TRUE, error_message = \"Error\"), button_Input(\"btn1\", \"Toggle error\") ), footer(TRUE) ) server <- function(input, output, session) { err <<- FALSE observeEvent(input$btn1,{ if (err) { err <<- FALSE error_off(\"text_area\") } else { err <<- TRUE error_on(\"text_area\", \"You have an error\") } } ) }"},{"path":"/index.html","id":"example-version","dir":"","previous_headings":"Components available :","what":"Example Version","title":"Custom Gov Style Inputs for Shiny","text":"can run example dashboard. rough improved.","code":"run_example()"},{"path":"/reference/accordion.html","id":null,"dir":"Reference","previous_headings":"","what":"Accordion Function — accordion","title":"Accordion Function — accordion","text":"function inserts accordion","code":""},{"path":"/reference/accordion.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Accordion Function — accordion","text":"","code":"accordion(inputId, titles, descriptions)"},{"path":"/reference/accordion.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Accordion Function — accordion","text":"inputId Input id accordion titles Add titles accordion descriptions Add main text accordion","code":""},{"path":"/reference/accordion.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Accordion Function — accordion","text":"accordion html shiny object","code":""},{"path":"/reference/accordion.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Accordion Function — accordion","text":"","code":"if (interactive()) { ui <- fluidPage( shinyGovstyle::header( main_text = \"Example\", secondary_text = \"User Examples\", logo=\"shinyGovstyle/images/moj_logo.png\"), shinyGovstyle::banner( inputId = \"banner\", type = \"beta\", 'This is a new service'), shinyGovstyle::gov_layout(size = \"two-thirds\", accordion( \"acc1\", c(\"Writing well for the web\", \"Writing well for specialists\", \"Know your audience\", \"How people read\" ), c(\"This is the content for Writing well for the web.\", \"This is the content for Writing well for specialists.\", \"This is the content for Know your audience.\", \"This is the content for How people read.\" ))), shinyGovstyle::footer(full = TRUE) ) server <- function(input, output, session) {} shinyApp(ui = ui, server = server) }"},{"path":"/reference/backlink_Input.html","id":null,"dir":"Reference","previous_headings":"","what":"Back Link Function — backlink_Input","title":"Back Link Function — backlink_Input","text":"function adds back link page","code":""},{"path":"/reference/backlink_Input.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Back Link Function — backlink_Input","text":"","code":"backlink_Input(inputId, label = \"Back\")"},{"path":"/reference/backlink_Input.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Back Link Function — backlink_Input","text":"inputId input slot used access value. label link text backlink, default \"Back\"","code":""},{"path":"/reference/backlink_Input.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Back Link Function — backlink_Input","text":"backlink html shiny object","code":""},{"path":"/reference/backlink_Input.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Back Link Function — backlink_Input","text":"","code":"if (interactive()) { ui <- fluidPage( header( main_text = \"Example\", secondary_text = \"User Examples\", logo=\"shinyGovstyle/images/moj_logo.png\"), shiny::navlistPanel( \"\", id=\"nav\", widths = c(2, 10), well = FALSE, #Create first panel shiny::tabPanel( \"Select Types\", value = \"panel1\", gov_layout(size = \"two-thirds\", backlink_Input(\"link1\"), shiny::tags$br(), shiny::tags$br() )), shiny::tabPanel( \"Tab2\", value = \"panel2\")), shinyGovstyle::footer(full = TRUE) ) server <- function(input, output, session) { #Slightly confused in that it goes forward rather than back, but shows how #to use observeEvent(input$link1,{ updateTabsetPanel(session, \"nav\", selected = \"panel2\") }) } shinyApp(ui = ui, server = server) }"},{"path":"/reference/banner.html","id":null,"dir":"Reference","previous_headings":"","what":"Banner Function — banner","title":"Banner Function — banner","text":"function create detail component can click details.","code":""},{"path":"/reference/banner.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Banner Function — banner","text":"","code":"banner(inputId, type, label)"},{"path":"/reference/banner.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Banner Function — banner","text":"inputId input slot used access value. type Main type label e.g. alpha beta. Can word. label test display.","code":""},{"path":"/reference/banner.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Banner Function — banner","text":"banner html shiny object","code":""},{"path":"/reference/banner.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Banner Function — banner","text":"","code":"if (interactive()) { ui <- fluidPage( shinyGovstyle::header( main_text = \"Example\", secondary_text = \"User Examples\", logo=\"shinyGovstyle/images/moj_logo.png\"), shinyGovstyle::banner( inputId = \"banner\", type = \"Beta\", 'This is a new service') ) server <- function(input, output, session) {} shinyApp(ui = ui, server = server) }"},{"path":"/reference/button_Input.html","id":null,"dir":"Reference","previous_headings":"","what":"Button Function — button_Input","title":"Button Function — button_Input","text":"function create gov style button","code":""},{"path":"/reference/button_Input.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Button Function — button_Input","text":"","code":"button_Input(inputId, label, type = \"default\")"},{"path":"/reference/button_Input.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Button Function — button_Input","text":"inputId input slot used access value. label Display label control, NULL label. type type button. Options default, start, secondary warning. Defaults default.","code":""},{"path":"/reference/button_Input.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Button Function — button_Input","text":"html button shiny object","code":""},{"path":"/reference/button_Input.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Button Function — button_Input","text":"","code":"if (interactive()) { ui <- fluidPage( shinyGovstyle::header( main_text = \"Example\", secondary_text = \"User Examples\", logo=\"shinyGovstyle/images/moj_logo.png\"), shinyGovstyle::gov_layout(size = \"two-thirds\", shinyGovstyle::button_Input( inputId = \"btn1\", label = \"Continue\", type = \"default\") ), shinyGovstyle::footer(full = TRUE) ) server <- function(input, output, session) {} shinyApp(ui = ui, server = server) }"},{"path":"/reference/checkbox_Input.html","id":null,"dir":"Reference","previous_headings":"","what":"Checkbox Function — checkbox_Input","title":"Checkbox Function — checkbox_Input","text":"function inserts checkbox group","code":""},{"path":"/reference/checkbox_Input.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Checkbox Function — checkbox_Input","text":"","code":"checkbox_Input( inputId, cb_labels, checkboxIds, label, hint_label = NULL, small = FALSE, error = FALSE, error_message = NULL )"},{"path":"/reference/checkbox_Input.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Checkbox Function — checkbox_Input","text":"inputId Input id group checkboxes cb_labels Add names options appear checkboxIds Add values checkbox label Insert text checkbox group. hint_label Insert optional hint/secondary text. Defaults NULL small change sizing small version checkbox. Defaults FALSE error Whenever want include error handle component. error_message want default error message.","code":""},{"path":"/reference/checkbox_Input.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Checkbox Function — checkbox_Input","text":"checkbox html shiny object","code":""},{"path":"/reference/checkbox_Input.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Checkbox Function — checkbox_Input","text":"","code":"if (interactive()) { ui <- fluidPage( # Required for error handling function shinyjs::useShinyjs(), shinyGovstyle::header( main_text = \"Example\", secondary_text = \"User Examples\", logo=\"shinyGovstyle/images/moj_logo.png\"), shinyGovstyle::banner( inputId = \"banner\", type = \"beta\", 'This is a new service'), shinyGovstyle::gov_layout(size = \"two-thirds\", # Simple checkbox shinyGovstyle::checkbox_Input( inputId = \"check1\", cb_labels = c(\"Option 1\", \"Option 2\", \"Option 3\"), checkboxIds = c(\"op1\", \"op2\", \"op3\"), label = \"Choice option\"), # Error checkbox shinyGovstyle::checkbox_Input( inputId = \"check2\", cb_labels = c(\"Option 1\", \"Option 2\", \"Option 3\"), checkboxIds = c(\"op1\", \"op2\", \"op3\"), label = \"Choice option\", hint_label = \"Select the best fit\", error = TRUE, error_message = \"Select one\"), # Button to trigger error shinyGovstyle::button_Input(inputId = \"submit\", label = \"Submit\") ), shinyGovstyle::footer(full = TRUE) ) server <- function(input, output, session) { #'Trigger error on blank submit of eventId2 observeEvent(input$submit, { if (is.null(input$check2)){ shinyGovstyle::error_on(inputId = \"check2\") } else { shinyGovstyle::error_off(inputId = \"check2\") } }) } shinyApp(ui = ui, server = server) }"},{"path":"/reference/clean_heading_text.html","id":null,"dir":"Reference","previous_headings":"","what":"Clean heading text function This internal function is used in subcontents_links and heading_text to create an automated link between the two — clean_heading_text","title":"Clean heading text function This internal function is used in subcontents_links and heading_text to create an automated link between the two — clean_heading_text","text":"Clean heading text function internal function used subcontents_links heading_text create automated link two","code":""},{"path":"/reference/clean_heading_text.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Clean heading text function This internal function is used in subcontents_links and heading_text to create an automated link between the two — clean_heading_text","text":"","code":"clean_heading_text(text)"},{"path":"/reference/clean_heading_text.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Clean heading text function This internal function is used in subcontents_links and heading_text to create an automated link between the two — clean_heading_text","text":"text string","code":""},{"path":"/reference/clean_heading_text.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Clean heading text function This internal function is used in subcontents_links and heading_text to create an automated link between the two — clean_heading_text","text":"string","code":""},{"path":"/reference/contents_link.html","id":null,"dir":"Reference","previous_headings":"","what":"Contents link function — contents_link","title":"Contents link function — contents_link","text":"function creates action link nav tabs optionally link subcontents headers.","code":""},{"path":"/reference/contents_link.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Contents link function — contents_link","text":"","code":"contents_link(link_text, input_id, subcontents_text_list, subcontents_id_list)"},{"path":"/reference/contents_link.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Contents link function — contents_link","text":"link_text vector link text contents input_id contents button id subcontents_text_list vector link text subcontents subcontents_id_list vector link ids subcontents. missing automatically matches id shinygovstyle::heading_text","code":""},{"path":"/reference/contents_link.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Contents link function — contents_link","text":"action button html shiny object","code":""},{"path":"/reference/contents_link.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Contents link function — contents_link","text":"","code":"if (interactive()) { ui <- shiny::fluidPage( title=\"ShinyGovstyle\", cookieBanner(\"Run Example\"), header(\"MOJ\", \"ShinyGovstyle Example\", logo=\"shinyGovstyle/images/moj_logo-1.png\", logo_width = 66), banner( \"banner\", \"Beta\", 'This is a new service \\u002D your
feedback<\/a> will help us to improve it.'), #Need this to make the error and word count work shinyjs::useShinyjs(), #Add a message to show users how to see this code shiny::tags$br(), shiny::markdown( \"Run ```View(run_example)``` in console to see the code for this app\"), gov_row( # Nav columns shiny::column( width = 3, id = \"nav\", # DO NOT REMOVE ID # Contents box shiny::tags$div( id = \"govuk-contents-box\", #DO NOT REMOVE ID class = \"govuk-contents-box\", #DO NOT REMOVE CLASS shiny::tags$h2(\"Contents\"), # Text types tab contents_link( \"Text Types\", \"text_types_button\", subcontents_text_list = c(\"date_Input\", \"text_Input\", \"text_area_Input\", \"button_Input\"), subcontents_id_list = c(NA, NA, NA, \"button_input_text_types\") ), # Tables tabs and accordions tab contents_link( \"Tables, tabs and accordions\", \"tables_tabs_and_accordions_button\", subcontents_text_list = c(\"govTable\", \"govTabs\", \"accordions\", \"button_Input\"), subcontents_id_list = c(NA, NA, NA, \"button_input_tables_tabs_accordions\") ), contents_link( \"Cookies\", \"cookies_button\"), ) ), shiny::column( width = 9, id = \"main_col\", # DO NOT REMOVE ID #Set up a nav panel so everything not on single page shiny::tabsetPanel( type = \"hidden\", id = \"tab-container\", # DO NOT REMOVE ID shiny::tabPanel( \"Text Types\", value = \"text_types\", gov_layout( size = \"two-thirds\", backlink_Input(\"back1\"), heading_text(\"Page 2\", size = \"l\"), label_hint(\"label2\", \"These are some examples of the types of user text inputs that you can use\"), heading_text(\"date_Input\", size = \"s\"), date_Input( inputId = \"date1\", label = \"What is your date of birth?\", hint_label = \"For example, 31 3 1980\"), heading_text(\"text_Input\", size = \"s\"), text_Input(inputId = \"txt1\", label = \"Event name\"), heading_text(\"text_area_Input\", size = \"s\"), text_area_Input( inputId = \"text_area1\", label = \"Can you provide more detail?\", hint_label = \"Do not include personal or financial information, like your National Insurance number or credit card details.\"), text_area_Input( inputId = \"text_area2\", label = \"How are you today?\", hint_label = \"Leave blank to trigger error\", error = T, error_message = \"Please do not leave blank\", word_limit = 300), heading_text( \"button_Input\", size = \"s\", id = \"button_input_text_types\"), button_Input(\"btn2\", \"Go to next page\"), button_Input(\"btn3\", \"Check for errors\", type = \"warning\") ) ), shiny::tabPanel( \"Tables, tabs and accordions\", value = \"tables_tabs_and_accordions\", gov_layout( size = \"two-thirds\", backlink_Input(\"back2\"), heading_text(\"Page 3\", size = \"l\"), label_hint(\"label3\", \"These are some examples of using tabs and tables\"), heading_text(\"govTable\", size = \"s\"), heading_text(\"govTabs\", size = \"s\"), heading_text(\"accordions\", size = \"s\"), shinyGovstyle:: accordion( \"acc1\", c(\"Writing well for the web\", \"Writing well for specialists\", \"Know your audience\", \"How people read\" ), c(\"This is the content for Writing well for the web.\", \"This is the content for Writing well for specialists.\", \"This is the content for Know your audience.\", \"This is the content for How people read.\" )), heading_text( \"button_Input\", size = \"s\", id = \"button_input_tables_tabs_accordions\"), button_Input(\"btn4\", \"Go to next page\"), ) ), #####################Create cookie panel################################ shiny::tabPanel( \"Cookies\", value = \"panel-cookies\", gov_layout( size = \"two-thirds\", heading_text(\"Cookie page\", size = \"l\"), label_hint(\"label-cookies\", \"This an example cookie page that could be expanded\") ) ))) ), #end of gov row footer(TRUE) ) #end of fluid page server <- function(input, output, session) { # Tab nav shiny::observeEvent(input$back2, { shiny::updateTabsetPanel(session, \"tab-container\", selected = \"text_types\") }) shiny::observeEvent(input$tables_tabs_and_accordions_button, { shiny::updateTabsetPanel(session, \"tab-container\", selected = \"tables_tabs_and_accordions\") }) shiny::observeEvent(input$cookies_button, { shiny::updateTabsetPanel(session, \"tab-container\", selected = \"panel-cookies\") }) } shiny::shinyApp(ui = ui, server = server) }"},{"path":"/reference/cookieBanner.html","id":null,"dir":"Reference","previous_headings":"","what":"Cookie Banner Function — cookieBanner","title":"Cookie Banner Function — cookieBanner","text":"function creates cookie banner. need shinyjs::useShinyjs() enabled work. ids pre set. See example structure.","code":""},{"path":"/reference/cookieBanner.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Cookie Banner Function — cookieBanner","text":"","code":"cookieBanner(service_name)"},{"path":"/reference/cookieBanner.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Cookie Banner Function — cookieBanner","text":"service_name Name service add banner","code":""},{"path":"/reference/cookieBanner.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Cookie Banner Function — cookieBanner","text":"cookie banner html shiny object.","code":""},{"path":"/reference/cookieBanner.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Cookie Banner Function — cookieBanner","text":"","code":"if (interactive()) { ui <- fluidPage( shinyGovstyle::header( main_text = \"Example\", secondary_text = \"User Examples\", logo=\"shinyGovstyle/images/moj_logo.png\"), #Needs shinyjs to work shinyjs::useShinyjs(), shinyGovstyle::cookieBanner(\"The best thing\"), shinyGovstyle::gov_layout(size = \"two-thirds\"), shinyGovstyle::footer(full = TRUE) ) server <- function(input, output, session) { #Need these set of observeEvent to create a path through the cookie banner observeEvent(input$cookieAccept, { shinyjs::show(id = \"cookieAcceptDiv\") shinyjs::hide(id = \"cookieMain\") }) observeEvent(input$cookieReject, { shinyjs::show(id = \"cookieRejectDiv\") shinyjs::hide(id = \"cookieMain\") }) observeEvent(input$hideAccept, { shinyjs::toggle(id = \"cookieDiv\") }) observeEvent(input$hideReject, { shinyjs::toggle(id = \"cookieDiv\") }) observeEvent(input$cookieLink, { #Need to link here to where further info is located. You can use #updateTabsetPanel to have a cookie page for instance }) } shinyApp(ui = ui, server = server) }"},{"path":"/reference/date_Input.html","id":null,"dir":"Reference","previous_headings":"","what":"Date Input Function — date_Input","title":"Date Input Function — date_Input","text":"function create date input follows GDS component","code":""},{"path":"/reference/date_Input.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Date Input Function — date_Input","text":"","code":"date_Input( inputId, label, hint_label = NULL, error = FALSE, error_message = NULL, day = NULL, month = NULL, year = NULL )"},{"path":"/reference/date_Input.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Date Input Function — date_Input","text":"inputId input slot used access value. label Display label control, NULL label. hint_label Display hint label control, NULL hint label. error Whenever include error components.Defaults FALSE. error_message Error handling message? Defaults NULL day Select default day start . Defaults NULL month Select default month start . Defaults NULL year Select default year start . Defaults NULL","code":""},{"path":"/reference/date_Input.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Date Input Function — date_Input","text":"data input html shiny object","code":""},{"path":"/reference/date_Input.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Date Input Function — date_Input","text":"","code":"if (interactive()) { ui <- fluidPage( # Required for error handling function. shinyjs::useShinyjs(), shinyGovstyle::header( main_text = \"Example\", secondary_text = \"User Examples\", logo=\"shinyGovstyle/images/moj_logo.png\"), shinyGovstyle::banner( inputId = \"banner\", type = \"beta\", 'This is a new service'), shinyGovstyle::gov_layout(size = \"two-thirds\", # Simple date input shinyGovstyle::date_Input( inputId = \"dob_input\", label = \"Please enter your birthday\"), # Error date input shinyGovstyle::date_Input( inputId = \"dob_input2\", label = \"Please enter your birthday\", hint_label = \"For example, 12 11 2007\", error = TRUE), # Button to trigger error shinyGovstyle::button_Input(inputId = \"submit\", label = \"Submit\") ), shinyGovstyle::footer(full = TRUE) ) server <- function(input, output, session) { #'Trigger error on blank submit of dob_input2 observeEvent(input$submit, { if (input$dob_input2 == \"//\"){ shinyGovstyle::error_on(inputId = \"dob_input2\") } else { shinyGovstyle::error_off( inputId = \"dob_input2\") } }) } shinyApp(ui = ui, server = server) }"},{"path":"/reference/details.html","id":null,"dir":"Reference","previous_headings":"","what":"Details Function — details","title":"Details Function — details","text":"function create detail component can click details.","code":""},{"path":"/reference/details.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Details Function — details","text":"","code":"details(inputId, label, help_text)"},{"path":"/reference/details.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Details Function — details","text":"inputId input slot used access value. label Main label text help_text Additional help information component.","code":""},{"path":"/reference/details.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Details Function — details","text":"details box html shiny object","code":""},{"path":"/reference/details.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Details Function — details","text":"","code":"if (interactive()) { ui <- fluidPage( shinyGovstyle::header( main_text = \"Example\", secondary_text = \"User Examples\", logo=\"shinyGovstyle/images/moj_logo.png\"), shinyGovstyle::gov_layout(size = \"two-thirds\", shinyGovstyle::details( inputId = \"help_div\", label = \"Help with form\", help_text = \"To complete the form you need to fill it in...\") ), shinyGovstyle::footer(full = TRUE) ) server <- function(input, output, session) {} shinyApp(ui = ui, server = server) }"},{"path":"/reference/error_off.html","id":null,"dir":"Reference","previous_headings":"","what":"Error off Function — error_off","title":"Error off Function — error_off","text":"function turns error o component, issues sorted.","code":""},{"path":"/reference/error_off.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Error off Function — error_off","text":"","code":"error_off(inputId)"},{"path":"/reference/error_off.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Error off Function — error_off","text":"inputId inputId turn error handling iff .","code":""},{"path":"/reference/error_off.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Error off Function — error_off","text":"return value. toggles error css","code":""},{"path":"/reference/error_off.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Error off Function — error_off","text":"","code":"## Only run examples in interactive R sessions if (interactive()) { ui <- fluidPage( # Required for error handling function shinyjs::useShinyjs(), shinyGovstyle::header( main_text = \"Example\", secondary_text = \"User Examples\", logo=\"shinyGovstyle/images/moj_logo.png\"), shinyGovstyle::banner( inputId = \"banner\", type = \"beta\", 'This is a new service'), shinyGovstyle::gov_layout(size = \"two-thirds\", # Error text box shinyGovstyle::text_Input( inputId = \"eventId\", label = \"Event Name\", error = TRUE), # Button to trigger error shinyGovstyle::button_Input(inputId = \"submit\", label = \"Submit\") ), shinyGovstyle::footer(full = TRUE) ) server <- function(input, output, session) { #Trigger error on blank submit of eventId2 observeEvent(input$submit, { if (input$eventId != \"\"){ shinyGovstyle::error_off(inputId = \"eventId\") } else { shinyGovstyle::error_on( inputId = \"eventId\", error_message = \"Please complete\") } }) } # Run the application shinyApp(ui = ui, server = server) }"},{"path":"/reference/error_on.html","id":null,"dir":"Reference","previous_headings":"","what":"Error on Function — error_on","title":"Error on Function — error_on","text":"function turns error o component. Can used validate inputs.","code":""},{"path":"/reference/error_on.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Error on Function — error_on","text":"","code":"error_on(inputId, error_message = NULL)"},{"path":"/reference/error_on.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Error on Function — error_on","text":"inputId input id turn error . error_message want add additional error message. Defaults NULL, showing original designed error message","code":""},{"path":"/reference/error_on.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Error on Function — error_on","text":"return value. toggles error css","code":""},{"path":"/reference/error_on.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Error on Function — error_on","text":"","code":"## Only run examples in interactive R sessions if (interactive()) { ui <- fluidPage( # Required for error handling function shinyjs::useShinyjs(), shinyGovstyle::header( main_text = \"Example\", secondary_text = \"User Examples\", logo=\"shinyGovstyle/images/moj_logo.png\"), shinyGovstyle::banner( inputId = \"banner\", type = \"beta\", 'This is a new service'), shinyGovstyle::gov_layout(size = \"two-thirds\", # Error text box shinyGovstyle::text_Input( inputId = \"eventId\", label = \"Event Name\", error = TRUE), # Button to trigger error shinyGovstyle::button_Input(inputId = \"submit\", label = \"Submit\") ), shinyGovstyle::footer(full = TRUE) ) server <- function(input, output, session) { #Trigger error on blank submit of eventId2 observeEvent(input$submit, { if (input$eventId != \"\"){ shinyGovstyle::error_off(inputId = \"eventId\") } else { shinyGovstyle::error_on( inputId = \"eventId\", error_message = \"Please complete\") } }) } # Run the application shinyApp(ui = ui, server = server) }"},{"path":"/reference/error_summary.html","id":null,"dir":"Reference","previous_headings":"","what":"Error Summary Function — error_summary","title":"Error Summary Function — error_summary","text":"function loads error summary component display error text. replicates gov style error boxes linked : https://design-system.service.gov.uk/components/error-summary/","code":""},{"path":"/reference/error_summary.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Error Summary Function — error_summary","text":"","code":"error_summary(inputId, error_title, error_list)"},{"path":"/reference/error_summary.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Error Summary Function — error_summary","text":"inputId input slot used access value. error_title title error summary. error_list list text values displayed error body.","code":""},{"path":"/reference/error_summary.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Error Summary Function — error_summary","text":"error_summary html shiny object","code":""},{"path":"/reference/error_summary.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Error Summary Function — error_summary","text":"","code":"if (interactive()) { ui <- fluidPage( shinyjs::useShinyjs(), shinyGovstyle::header( main_text = \"Example\", secondary_text = \"User Examples\", logo = \"shinyGovstyle/images/moj_logo.png\" ), shinyGovstyle::gov_layout( size = \"two-thirds\", error_summary( inputId = \"errorId\", error_title = \"Error title\", error_list = c(\"error item1\", \"error item2\") ) ), shinyGovstyle::button_Input(\"btn1\", \"Change error summary\"), shinyGovstyle::footer(full = TRUE) ) server <- function(input, output, session) { shiny::observeEvent(input$btn1, { error_summary_update( \"errorId\", c(\"error item1\", \"error item2\", \"error item3\") )}, ignoreInit = TRUE ) } shinyApp(ui = ui, server = server) }"},{"path":"/reference/error_summary_update.html","id":null,"dir":"Reference","previous_headings":"","what":"Error Summary Update Function — error_summary_update","title":"Error Summary Update Function — error_summary_update","text":"function changes text displays error summary box. Requires shinyjs::useShinyjs() work.","code":""},{"path":"/reference/error_summary_update.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Error Summary Update Function — error_summary_update","text":"","code":"error_summary_update(inputId, error_list)"},{"path":"/reference/error_summary_update.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Error Summary Update Function — error_summary_update","text":"inputId inputid error summary want update error_list updated list text values displayed error body.","code":""},{"path":"/reference/error_summary_update.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Error Summary Update Function — error_summary_update","text":"update error summary box","code":""},{"path":"/reference/error_summary_update.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Error Summary Update Function — error_summary_update","text":"","code":"if (interactive()) { ui <- fluidPage( shinyjs::useShinyjs(), shinyGovstyle::header( main_text = \"Example\", secondary_text = \"User Examples\", logo = \"shinyGovstyle/images/moj_logo.png\" ), shinyGovstyle::gov_layout( size = \"two-thirds\", error_summary( inputId = \"errorId\", error_title = \"Error title\", error_list = c(\"error item1\", \"error item2\") ) ), shinyGovstyle::button_Input(\"btn1\", \"Change error summary\"), shinyGovstyle::footer(full = TRUE) ) server <- function(input, output, session) { shiny::observeEvent(input$btn1, { error_summary_update( \"errorId\", c(\"error item1\", \"error item2\", \"error item3\") )}, ignoreInit = TRUE ) } shinyApp(ui = ui, server = server) }"},{"path":"/reference/file_Input.html","id":null,"dir":"Reference","previous_headings":"","what":"File Input Function — file_Input","title":"File Input Function — file_Input","text":"function create file upload component. uses basis shiny fileInput function, restyles label adds error onto . look like www.gov.uk/ style one, although www.gov.uk/ seem settle style , example changes Firefox Chrome","code":""},{"path":"/reference/file_Input.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"File Input Function — file_Input","text":"","code":"file_Input( inputId, label, multiple = FALSE, accept = NULL, width = NULL, buttonLabel = \"Choose file\", placeholder = \"No file chosen\", error = FALSE, error_message = NULL )"},{"path":"/reference/file_Input.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"File Input Function — file_Input","text":"inputId input slot used access value. label Display label control, NULL label. multiple Whether user allowed select upload multiple files . work older browsers, including Internet Explorer 9 earlier. accept character vector MIME types; gives browser hint kind files server expecting. width width input, e.g. '400px', '100%' buttonLabel label used button. Can text HTML tag object. placeholder text show file uploaded. error Whenever icnlud error handling Defaults FALSE. error_message Message display error. Defaults NULL","code":""},{"path":"/reference/file_Input.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"File Input Function — file_Input","text":"file input html shiny object","code":""},{"path":"/reference/file_Input.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"File Input Function — file_Input","text":"","code":"if (interactive()) { ui <- fluidPage( # Required for error handling function shinyjs::useShinyjs(), shinyGovstyle::header( main_text = \"Example\", secondary_text = \"User Examples\", logo=\"shinyGovstyle/images/moj_logo.png\"), shinyGovstyle::banner( inputId = \"banner\", type = \"beta\", 'This is a new service'), shinyGovstyle::gov_layout(size = \"two-thirds\", # Simple file input shinyGovstyle::file_Input(inputId = \"file1\", label = \"Upload a file\"), # Error file shinyGovstyle::file_Input( inputId = \"file2\", label = \"Upload a file\", error = TRUE), # Button to trigger error shinyGovstyle::button_Input(inputId = \"submit\", label = \"Submit\") ), shinyGovstyle::footer(full = TRUE) ) server <- function(input, output, session) { #'Trigger error on blank submit of file2 observeEvent(input$submit, { if (is.null(input$file2)){ shinyGovstyle::error_on(inputId = \"file2\") } else { shinyGovstyle::error_off( inputId = \"file2\") } }) } shinyApp(ui = ui, server = server) }"},{"path":"/reference/font.html","id":null,"dir":"Reference","previous_headings":"","what":"Font Function — font","title":"Font Function — font","text":"function adds rge nta fonts app. See https://design-system.service.gov.uk/styles/typography/ allowed.","code":""},{"path":"/reference/font.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Font Function — font","text":"","code":"font()"},{"path":"/reference/font.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Font Function — font","text":"value returned. loads font css file","code":""},{"path":"/reference/font.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Font Function — font","text":"","code":"if (interactive()) { ui <- fluidPage( font(), shinyGovstyle::header( main_text = \"Example\", secondary_text = \"User Examples\", logo=\"shinyGovstyle/images/moj_logo.png\") ) server <- function(input, output, session) {} shinyApp(ui = ui, server = server) }"},{"path":"/reference/footer.html","id":null,"dir":"Reference","previous_headings":"","what":"Footer Function — footer","title":"Footer Function — footer","text":"function create gov style footer page","code":""},{"path":"/reference/footer.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Footer Function — footer","text":"","code":"footer(full = FALSE)"},{"path":"/reference/footer.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Footer Function — footer","text":"full Whenever want blank footer official gov version. Defaults FALSE","code":""},{"path":"/reference/footer.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Footer Function — footer","text":"footer html shiny object","code":""},{"path":"/reference/footer.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Footer Function — footer","text":"","code":"if (interactive()) { ui <- fluidPage( shinyGovstyle::header( main_text = \"Example\", secondary_text = \"User Examples\", logo=\"shinyGovstyle/images/moj_logo.png\"), shinyGovstyle::banner( inputId = \"banner\", type = \"beta\", 'This is a new service'), tags$br(), tags$br(), shinyGovstyle::footer(full = TRUE) ) server <- function(input, output, session) {} shinyApp(ui = ui, server = server) }"},{"path":"/reference/govTable.html","id":null,"dir":"Reference","previous_headings":"","what":"Table Function — govTable","title":"Table Function — govTable","text":"function inserts gov styled table. Format header looking rows columns","code":""},{"path":"/reference/govTable.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Table Function — govTable","text":"","code":"govTable( inputId, df, caption, caption_size = \"l\", num_col = NULL, width_overwrite = NULL )"},{"path":"/reference/govTable.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Table Function — govTable","text":"inputId Input id table df expects dataframe create table caption adds caption table header caption_size adjust size caption. Options s, m, l, xl, l default num_col adds numeric class format columns. width_overwrite change width. Need include width every column. Options three-quarters, two-thirds, one-half, one-third, one-quarter. Default NULL.","code":""},{"path":"/reference/govTable.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Table Function — govTable","text":"table html shiny object","code":""},{"path":"/reference/govTable.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Table Function — govTable","text":"","code":"if (interactive()) { Months <- c(\"January\", \"February\", \"March\") Bikes <- c(\"£85\", \"£75\", \"£165\") Cars <- c(\"£95\", \"£55\", \"£125\") example_data <- data.frame(Months, Bikes, Cars) ui <- fluidPage( shinyGovstyle::header( main_text = \"Example\", secondary_text = \"User Examples\", logo=\"shinyGovstyle/images/moj_logo.png\"), shinyGovstyle::banner( inputId = \"banner\", type = \"beta\", 'This is a new service'), shinyGovstyle::gov_layout(size = \"two-thirds\", shinyGovstyle::govTable( \"tab1\", example_data, \"Test\", \"l\", num_col = c(2,3), width_overwrite = c(\"one-half\", \"one-quarter\", \"one-quarter\")) ), shinyGovstyle::footer(full = TRUE) ) server <- function(input, output, session) {} shinyApp(ui = ui, server = server) }"},{"path":"/reference/govTabs.html","id":null,"dir":"Reference","previous_headings":"","what":"Tabs Function — govTabs","title":"Tabs Function — govTabs","text":"function creates tabs based table. requires single dataframe grouping variable","code":""},{"path":"/reference/govTabs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Tabs Function — govTabs","text":"","code":"govTabs(inputId, df, group_col)"},{"path":"/reference/govTabs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Tabs Function — govTabs","text":"inputId id access tag df single dataframe data. See example structure. group_col column name groups used tabs","code":""},{"path":"/reference/govTabs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Tabs Function — govTabs","text":"tab table html shiny object.","code":""},{"path":"/reference/govTabs.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Tabs Function — govTabs","text":"","code":"if (interactive()) { # Create an example dataset tabs <- c(rep(\"Past Day\", 3), rep(\"Past Week\", 3), rep(\"Past Month\", 3), rep(\"Past Year\", 3)) Case_manager <- rep(c(\"David Francis\", \"Paul Farmer\", \"Rita Patel\"),4) Cases_open <- c(3, 1, 2, 24, 16, 24, 98, 122, 126, 1380, 1129, 1539) Cases_closed <- c(0, 0, 0, 18, 20, 27, 95, 131, 142, 1472, 1083, 1265) data <- data.frame(tabs, Case_manager, Cases_open, Cases_closed) ui <- fluidPage( shinyGovstyle::header( main_text = \"Example\", secondary_text = \"User Examples\", logo=\"shinyGovstyle/images/moj_logo.png\"), shinyGovstyle::gov_layout(size = \"two-thirds\", shinyGovstyle::govTabs(data, \"tabs\")), shinyGovstyle::footer(full = TRUE) ) server <- function(input, output, session) {} shinyApp(ui = ui, server = server) }"},{"path":"/reference/gov_layout.html","id":null,"dir":"Reference","previous_headings":"","what":"Page Layout Function — gov_layout","title":"Page Layout Function — gov_layout","text":"function loads page layout, work well `gov_main_layout` associated functions. kept now simpler version grids needed.","code":""},{"path":"/reference/gov_layout.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Page Layout Function — gov_layout","text":"","code":"gov_layout(..., inputID = \"main\", size = \"full\")"},{"path":"/reference/gov_layout.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Page Layout Function — gov_layout","text":"... include components UI want within main page. inputID ID main div. Defaults \"main\" size Layout page. Optional full, one-half, two-thirds, one-third one-quarter. Defaults \"full\"","code":""},{"path":"/reference/gov_layout.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Page Layout Function — gov_layout","text":"html shiny layout div","code":""},{"path":"/reference/gov_layout.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Page Layout Function — gov_layout","text":"","code":"if (interactive()) { ui <- fluidPage( shinyGovstyle::header( main_text = \"Example\", secondary_text = \"User Examples\", logo=\"shinyGovstyle/images/moj_logo.png\"), shinyGovstyle::gov_layout(size = \"full\", shinyGovstyle::panel_output( inputId = \"panel1\", main_text = \"Application Complete\", sub_text = \"Thank you for submitting your application. Your reference is xvsiq\") ), shinyGovstyle::footer(full = TRUE) ) server <- function(input, output, session) {} shinyApp(ui = ui, server = server) }"},{"path":"/reference/gov_summary.html","id":null,"dir":"Reference","previous_headings":"","what":"Tabs Function — gov_summary","title":"Tabs Function — gov_summary","text":"function creates tabs based table. requires single dataframe grouping variable","code":""},{"path":"/reference/gov_summary.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Tabs Function — gov_summary","text":"","code":"gov_summary(inputId, headers, info, action = FALSE, border = TRUE)"},{"path":"/reference/gov_summary.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Tabs Function — gov_summary","text":"inputId id access summary list headers input row headers value info summary information values table action whenever change link needed. sets input value headers using lowercase underscore replace gaps. Default set FALSE border set table borders. Default set TRUE","code":""},{"path":"/reference/gov_summary.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Tabs Function — gov_summary","text":"summary list table html shiny object.","code":""},{"path":"/reference/gov_summary.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Tabs Function — gov_summary","text":"","code":"if (interactive()) { # Create an example dataset headers <- c(\"Name\", \"Date of birth\", \"Contact information\", \"Contact details\") info <- c( \"Sarah Philips\", \"5 January 1978\", \"72 Guild Street
London
SE23 6FH\", \"07700 900457
sarah.phillips@example.com\") ui <- fluidPage( shinyGovstyle::header( main_text = \"Example\", secondary_text = \"User Examples\", logo=\"shinyGovstyle/images/moj_logo.png\"), shinyGovstyle::gov_layout(size = \"two-thirds\", shinyGovstyle::gov_summary(\"sumID\", headers, info, action = FALSE)), shinyGovstyle::footer(full = TRUE) ) server <- function(input, output, session) {} shinyApp(ui = ui, server = server) }"},{"path":"/reference/header.html","id":null,"dir":"Reference","previous_headings":"","what":"Header Function — header","title":"Header Function — header","text":"function create header banner. use top screen","code":""},{"path":"/reference/header.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Header Function — header","text":"","code":"header( main_text, secondary_text, logo = NULL, main_link = \"#\", secondary_link = \"#\", logo_width = 36, logo_height = 32 )"},{"path":"/reference/header.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Header Function — header","text":"main_text Main text goes header secondary_text Secondary header supplement main text logo Add link logo apply header. Use crown use crown svg version gov uk. main_link Add link clicking main text secondary_link Add link clicking secondary header. logo_width Change logo size width css improve fit logo_height Change logo size height css improve fit","code":""},{"path":"/reference/header.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Header Function — header","text":"header html shiny object","code":""},{"path":"/reference/header.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Header Function — header","text":"","code":"if (interactive()) { ui <- fluidPage( shinyGovstyle::header( main_text = \"Example\", secondary_text = \"User Examples\", logo=\"shinyGovstyle/images/moj_logo.png\") ) server <- function(input, output, session) {} shinyApp(ui = ui, server = server) }"},{"path":"/reference/heading_text.html","id":null,"dir":"Reference","previous_headings":"","what":"Heading Text Function — heading_text","title":"Heading Text Function — heading_text","text":"function create heading text","code":""},{"path":"/reference/heading_text.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Heading Text Function — heading_text","text":"","code":"heading_text(text_input, size = \"xl\", id)"},{"path":"/reference/heading_text.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Heading Text Function — heading_text","text":"text_input Text display size Text size using xl, l, m, s. Defaults xl. id Custom header id","code":""},{"path":"/reference/heading_text.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Heading Text Function — heading_text","text":"heading text html shiny object","code":""},{"path":"/reference/heading_text.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Heading Text Function — heading_text","text":"","code":"if (interactive()) { ui <- fluidPage( shinyGovstyle::header( main_text = \"Example\", secondary_text = \"User Examples\", logo=\"shinyGovstyle/images/moj_logo.png\"), shinyGovstyle::gov_layout(size = \"two-thirds\", shinyGovstyle::heading_text(\"This is great text\", \"m\") ), shinyGovstyle::footer(full = TRUE) ) server <- function(input, output, session) {} shinyApp(ui = ui, server = server) }"},{"path":"/reference/input_field.html","id":null,"dir":"Reference","previous_headings":"","what":"Input Field Function — input_field","title":"Input Field Function — input_field","text":"function inserts number text inputs. Useful addresses.","code":""},{"path":"/reference/input_field.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Input Field Function — input_field","text":"","code":"input_field( legend, labels, inputIds, widths = NULL, types = \"text\", error = FALSE, error_message = NULL )"},{"path":"/reference/input_field.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Input Field Function — input_field","text":"legend Legend goes fieldset labels list labels text inputs inputIds list input slots used access value. widths control size box based number characters required. Options 30, 20, 10, 5, 4, 3, 2. NULL limit size types text box types. default text. error Whenever icnlud error handling Defaults FALSE. error_message Message display error. Defaults NULL","code":""},{"path":"/reference/input_field.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Input Field Function — input_field","text":"input field html shiny object","code":""},{"path":"/reference/input_field.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Input Field Function — input_field","text":"","code":"if (interactive()) { ui <- fluidPage( # Required for error handling function shinyjs::useShinyjs(), shinyGovstyle::header( main_text = \"Example\", secondary_text = \"User Examples\", logo=\"shinyGovstyle/images/moj_logo.png\"), shinyGovstyle::banner( inputId = \"banner\", type = \"beta\", 'This is a new service'), shinyGovstyle::gov_layout(size = \"two-thirds\", shinyGovstyle::input_field( legend =\"List of three text boxes in a field\", labels = c(\"Field 1\", \"Field 2\", \"Field 3\"), inputIds = c(\"field1\", \"field2\", \"field3\"), widths = c(30,20,10), error = TRUE), # Button to trigger error shinyGovstyle::button_Input(inputId = \"submit\", label = \"Submit\") ), shinyGovstyle::footer(full = TRUE) ) server <- function(input, output, session) { # Trigger error on blank submit of field2 observeEvent(input$submit, { if (input$field2 == \"\"){ shinyGovstyle::error_on(inputId = \"field2\", error_message = \"Please complete\") } else { shinyGovstyle::error_off( inputId = \"field2\") } }) } shinyApp(ui = ui, server = server) }"},{"path":"/reference/insert_text.html","id":null,"dir":"Reference","previous_headings":"","what":"Insert Text Function — insert_text","title":"Insert Text Function — insert_text","text":"function loads insert text component display additional information special format.","code":""},{"path":"/reference/insert_text.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Insert Text Function — insert_text","text":"","code":"insert_text(inputId, text)"},{"path":"/reference/insert_text.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Insert Text Function — insert_text","text":"inputId input slot used access value. text Text want display insert","code":""},{"path":"/reference/insert_text.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Insert Text Function — insert_text","text":"insert text html shiny object","code":""},{"path":"/reference/insert_text.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Insert Text Function — insert_text","text":"","code":"if (interactive()) { ui <- fluidPage( shinyGovstyle::header( main_text = \"Example\", secondary_text = \"User Examples\", logo=\"shinyGovstyle/images/moj_logo.png\"), shinyGovstyle::gov_layout(size = \"two-thirds\", shinyGovstyle::insert_text( inputId = \"note\", text = \"It can take up to 8 weeks to register a lasting power of attorney if there are no mistakes in the application.\" ) ), shinyGovstyle::footer(full = TRUE) ) server <- function(input, output, session) {} shinyApp(ui = ui, server = server) }"},{"path":"/reference/label_hint.html","id":null,"dir":"Reference","previous_headings":"","what":"Label with Hint Function — label_hint","title":"Label with Hint Function — label_hint","text":"function inserts label optional hint","code":""},{"path":"/reference/label_hint.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Label with Hint Function — label_hint","text":"","code":"label_hint(inputId, label, hint_input = NULL)"},{"path":"/reference/label_hint.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Label with Hint Function — label_hint","text":"inputId input slot used access value. label Display label control, NULL label. hint_input Display hint label control, NULL hint label.","code":""},{"path":"/reference/label_hint.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Label with Hint Function — label_hint","text":"label hint html shiny object","code":""},{"path":"/reference/label_hint.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Label with Hint Function — label_hint","text":"","code":"if (interactive()) { ui <- fluidPage( shinyGovstyle::header( main_text = \"Example\", secondary_text = \"User Examples\", logo=\"shinyGovstyle/images/moj_logo.png\"), shinyGovstyle::gov_layout(size = \"two-thirds\", label_hint( inputId = \"label1\", label = \"This is a label\", hint_input = \"This is a hint\") ), shinyGovstyle::footer(full = TRUE) ) server <- function(input, output, session) {} shinyApp(ui = ui, server = server) }"},{"path":"/reference/layouts.html","id":null,"dir":"Reference","previous_headings":"","what":"Page Layout Functions — layouts","title":"Page Layout Functions — layouts","text":"function loads page layout gov layout. selection components can sit within . gov_main_layout overarching layout. gov_row creates row gov_box creates box within row. gov_text container text bodies.","code":""},{"path":"/reference/layouts.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Page Layout Functions — layouts","text":"","code":"gov_main_layout(..., inputID = \"main\") gov_row(...) gov_box(..., size = \"full\") gov_text(...)"},{"path":"/reference/layouts.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Page Layout Functions — layouts","text":"... include components UI want within main page. components made flow . See example inputID ID main div. Defaults \"main\" size size box row. Optional full, one-half, two-thirds, one-third one-quarter. Defaults \"full\"","code":""},{"path":"/reference/layouts.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Page Layout Functions — layouts","text":"html shiny layout div","code":""},{"path":"/reference/layouts.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Page Layout Functions — layouts","text":"","code":"if (interactive()) { ui <- fluidPage( shinyGovstyle::header( main_text = \"Example\", secondary_text = \"User Examples\", logo=\"shinyGovstyle/images/moj_logo.png\"), shinyGovstyle::gov_main_layout( shinyGovstyle::gov_row( shinyGovstyle::gov_box( size = \"full\", shinyGovstyle::gov_text(\"govuk-grid-column-full\") ) ), shinyGovstyle::gov_row( shinyGovstyle::gov_box( size = \"one-half\", shinyGovstyle::gov_text(\"govuk-grid-column-one-half\") ), shinyGovstyle::gov_box( size = \"one-half\", shinyGovstyle::gov_text(\"govuk-grid-column-one-half\") ) ), shinyGovstyle::gov_row( shinyGovstyle::gov_box( size = \"one-third\", shinyGovstyle::gov_text(\"govuk-grid-column-one-third\") ), shinyGovstyle::gov_box( size = \"two-third\", shinyGovstyle::gov_text(\"govuk-grid-column-two-third\") ) ), shinyGovstyle::gov_row( shinyGovstyle::gov_box( size = \"one-quarter\", shinyGovstyle::gov_text(\"govuk-grid-column-one-quarter\") ), shinyGovstyle::gov_box( size = \"three-quarters\", shinyGovstyle::gov_text(\"govuk-grid-column-three-quarters\") ) ) ), shinyGovstyle::footer(full = TRUE) ) server <- function(input, output, session) {} shinyApp(ui = ui, server = server) }"},{"path":"/reference/noti_banner.html","id":null,"dir":"Reference","previous_headings":"","what":"Notification Banner Function — noti_banner","title":"Notification Banner Function — noti_banner","text":"function create notification banner","code":""},{"path":"/reference/noti_banner.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Notification Banner Function — noti_banner","text":"","code":"noti_banner( inputId, title_txt = \"Important\", body_txt = NULL, type = \"standard\" )"},{"path":"/reference/noti_banner.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Notification Banner Function — noti_banner","text":"inputId input id banner title_txt wording appears title body_txt wording appears banner body type type banner. Options standard success. Standard default","code":""},{"path":"/reference/noti_banner.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Notification Banner Function — noti_banner","text":"notification html shiny object","code":""},{"path":"/reference/noti_banner.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Notification Banner Function — noti_banner","text":"","code":"if (interactive()) { ui <- fluidPage( shinyGovstyle::header( main_text = \"Example\", secondary_text = \"User Examples\", logo=\"shinyGovstyle/images/moj_logo.png\"), shinyGovstyle::noti_banner( inputId = \"banner\", title_txt = \"Important\", body_txt = \"Example text\") ) server <- function(input, output, session) {} shinyApp(ui = ui, server = server) }"},{"path":"/reference/panel_output.html","id":null,"dir":"Reference","previous_headings":"","what":"Panel output — panel_output","title":"Panel output — panel_output","text":"function inserts panel. Normally used confirmation screens","code":""},{"path":"/reference/panel_output.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Panel output — panel_output","text":"","code":"panel_output(inputId, main_text, sub_text)"},{"path":"/reference/panel_output.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Panel output — panel_output","text":"inputId input slot used access value. main_text Add header panel sub_text Add main body text panel","code":""},{"path":"/reference/panel_output.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Panel output — panel_output","text":"panel html shiny object","code":""},{"path":"/reference/panel_output.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Panel output — panel_output","text":"","code":"if (interactive()) { ui <- fluidPage( shinyGovstyle::header( main_text = \"Example\", secondary_text = \"User Examples\", logo=\"shinyGovstyle/images/moj_logo.png\"), shinyGovstyle::gov_layout(size = \"full\", shinyGovstyle::panel_output( inputId = \"panel1\", main_text = \"Application Complete\", sub_text = \"Thank you for submitting your application. Your reference is xvsiq\") ), shinyGovstyle::footer(full = TRUE) ) server <- function(input, output, session) {} shinyApp(ui = ui, server = server) }"},{"path":"/reference/pipe.html","id":null,"dir":"Reference","previous_headings":"","what":"Pipe operator — %>%","title":"Pipe operator — %>%","text":"See magrittr::%>% details.","code":""},{"path":"/reference/pipe.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pipe operator — %>%","text":"","code":"lhs %>% rhs"},{"path":"/reference/pipe.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Pipe operator — %>%","text":"lhs value magrittr placeholder. rhs function call using magrittr semantics.","code":""},{"path":"/reference/pipe.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Pipe operator — %>%","text":"result calling `rhs(lhs)`.","code":""},{"path":"/reference/radio_button_Input.html","id":null,"dir":"Reference","previous_headings":"","what":"Radio Button Function — radio_button_Input","title":"Radio Button Function — radio_button_Input","text":"function create radio buttons","code":""},{"path":"/reference/radio_button_Input.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Radio Button Function — radio_button_Input","text":"","code":"radio_button_Input( inputId, label, choices = NULL, selected = NULL, inline = FALSE, small = FALSE, choiceNames = NULL, choiceValues = NULL, hint_label = NULL, error = FALSE, error_message = NULL, custom_class = \"\" )"},{"path":"/reference/radio_button_Input.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Radio Button Function — radio_button_Input","text":"inputId input slot used access value. label Input label. choices List values select (elements list named name rather value displayed user) selected initially selected value. inline want radio inline , Default FALSE small want smaller versions radio buttons, Default FALSE choiceNames, choiceValues checkboxGroupInput. List names values, respectively, displayed user app correspond choice (reason must length). either arguments provided, must provided choices must provided. advantage using named list choices choiceNames allows type UI object passed (tag objects, icons, HTML code, ...), instead just simple text. hint_label Additional hint text may want display label. Defaults NULL error Whenever want include error handle component. error_message want default error message. custom_class want add additional classes radio buttons","code":""},{"path":"/reference/radio_button_Input.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Radio Button Function — radio_button_Input","text":"radio buttons html shiny object","code":""},{"path":"/reference/radio_button_Input.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Radio Button Function — radio_button_Input","text":"","code":"if (interactive()) { ui <- fluidPage( # Required for error handling function shinyjs::useShinyjs(), shinyGovstyle::header( main_text = \"Example\", secondary_text = \"User Examples\", logo=\"shinyGovstyle/images/moj_logo.png\"), shinyGovstyle::banner( inputId = \"banner\", type = \"beta\", 'This is a new service'), shinyGovstyle::gov_layout(size = \"two-thirds\", #Simple radio shinyGovstyle::radio_button_Input( inputId = \"radio1\", choices = c(\"Yes\", \"No\", \"Maybe\"), label = \"Choice option\"), # Error radio shinyGovstyle::radio_button_Input( inputId = \"radio2\", choices = c(\"Yes\", \"No\", \"Maybe\"), label = \"Choice option\", hint_label = \"Select the best fit\", inline = TRUE, error = TRUE, error_message = \"Select one\"), # Button to trigger error shinyGovstyle::button_Input(inputId = \"submit\", label = \"Submit\") ), shinyGovstyle::footer(full = TRUE) ) server <- function(input, output, session) { #Trigger error on blank submit of eventId2 observeEvent(input$submit, { if (is.null(input$radio2)){ shinyGovstyle::error_on(inputId = \"radio2\") } else { shinyGovstyle::error_off( inputId = \"radio2\") } }) } shinyApp(ui = ui, server = server) }"},{"path":"/reference/run_example.html","id":null,"dir":"Reference","previous_headings":"","what":"Example Function — run_example","title":"Example Function — run_example","text":"function runs shiny example using different parts package","code":""},{"path":"/reference/run_example.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Example Function — run_example","text":"","code":"run_example()"},{"path":"/reference/run_example.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Example Function — run_example","text":"shiny app examples ","code":""},{"path":"/reference/run_example.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Example Function — run_example","text":"","code":"if (interactive()) { run_example() }"},{"path":"/reference/select_Input.html","id":null,"dir":"Reference","previous_headings":"","what":"Select Function — select_Input","title":"Select Function — select_Input","text":"function inserts select box","code":""},{"path":"/reference/select_Input.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Select Function — select_Input","text":"","code":"select_Input(inputId, label, select_text, select_value)"},{"path":"/reference/select_Input.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Select Function — select_Input","text":"inputId Input id component label Insert text label. select_text Add text apply drop list select_value Add value used selection.","code":""},{"path":"/reference/select_Input.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Select Function — select_Input","text":"select input html shiny object","code":""},{"path":"/reference/select_Input.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Select Function — select_Input","text":"","code":"if (interactive()) { ui <- fluidPage( shinyGovstyle::header( main_text = \"Example\", secondary_text = \"User Examples\", logo=\"shinyGovstyle/images/moj_logo.png\"), shinyGovstyle::gov_layout(size = \"full\", select_Input( inputId = \"sorter\", label = \"Sort by\", select_text = c(\"Recently published\", \"Recently updated\", \"Most views\", \"Most comments\"), select_value = c(\"published\", \"updated\", \"view\", \"comments\")), tags$br() ), shinyGovstyle::footer(full = TRUE) ) server <- function(input, output, session) {} shinyApp(ui = ui, server = server) }"},{"path":"/reference/skip_to_main.html","id":null,"dir":"Reference","previous_headings":"","what":"Skip to main content link — skip_to_main","title":"Skip to main content link — skip_to_main","text":"function generates accessible 'Skip main content' link, typically used keyboard-users bypass content navigate directly main content page. Important: main column need id \"main_col\" work","code":""},{"path":"/reference/skip_to_main.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Skip to main content link — skip_to_main","text":"","code":"skip_to_main()"},{"path":"/reference/skip_to_main.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Skip to main content link — skip_to_main","text":"skip button skips section id \"main_col\"","code":""},{"path":"/reference/skip_to_main.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Skip to main content link — skip_to_main","text":"","code":"if (interactive()) { ui <- fluidPage( cookieBanner(\"Run Example\"), skip_to_main(), shinyGovstyle::header( main_text = \"Example\", secondary_text = \"User Examples\", logo=\"shinyGovstyle/images/moj_logo.png\" ), shinyjs::useShinyjs(), # shinyjs is needed to manage visibility of elements gov_row( shiny::column( width = 3, id = \"nav\", # Contents box shiny::tags$div( id = \"govuk-contents-box\", #DO NOT REMOVE ID class = \"govuk-contents-box\", #DO NOT REMOVE CLASS shiny::tags$h2(\"Contents\"), p(\"Your contents links go here\"), ) ), shiny::column( width = 9, id = \"main_col\", shiny::tabsetPanel( type = \"hidden\", id = \"tab-container\", # DO NOT REMOVE ID shiny::tabPanel( \"Your main content\", value = \"your_main_content\", gov_layout( size = \"two-thirds\", heading_text(\"Your main content\", size = \"l\"), heading_text(\"accordions\", size = \"s\"), shinyGovstyle:: accordion( \"acc1\", c(\"Writing well for the web\", \"Writing well for specialists\", \"Know your audience\", \"How people read\" ), c(\"This is the content for Writing well for the web.\", \"This is the content for Writing well for specialists.\", \"This is the content for Know your audience.\", \"This is the content for How people read.\" )), ) ) ) ) ) ) server <- function(input, output, session){ } shinyApp(ui = ui, server = server) }"},{"path":"/reference/subcontents_links.html","id":null,"dir":"Reference","previous_headings":"","what":"Subcontents links function This function is used internally within contents_link to create links to headings within pages. — subcontents_links","title":"Subcontents links function This function is used internally within contents_link to create links to headings within pages. — subcontents_links","text":"Subcontents links function function used internally within contents_link create links headings within pages.","code":""},{"path":"/reference/subcontents_links.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Subcontents links function This function is used internally within contents_link to create links to headings within pages. — subcontents_links","text":"","code":"subcontents_links(subcontents_text_list, subcontents_id_list)"},{"path":"/reference/subcontents_links.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Subcontents links function This function is used internally within contents_link to create links to headings within pages. — subcontents_links","text":"subcontents_text_list vector link text subcontents subcontents_id_list vector link ids subcontents. pass NAs automatic matching id shinygovstyle::heading_text","code":""},{"path":"/reference/subcontents_links.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Subcontents links function This function is used internally within contents_link to create links to headings within pages. — subcontents_links","text":"ol html shiny object","code":""},{"path":"/reference/subcontents_links.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Subcontents links function This function is used internally within contents_link to create links to headings within pages. — subcontents_links","text":"","code":"if (interactive()) { ui <- shiny::fluidPage( shinyGovstyle::header( main_text = \"Example\", secondary_text = \"User Examples\", logo = \"shinyGovstyle/images/moj_logo.png\" ), shiny::column( width = 3, id = \"nav\", shiny::tags$div( shiny::tags$h2(\"Contents\"), subcontents_links( c(\"radio_button_Input (inline)\", \"button_Input\"), c(NA, NA) ), subcontents_links( c(\"date_Input\", \"button_Input\"), c(NA, \"button_input_text_types\") ) ) ) ) server <- function(input, output, session) { } shiny::shinyApp(ui = ui, server = server) }"},{"path":"/reference/tag_Input.html","id":null,"dir":"Reference","previous_headings":"","what":"Tag Function — tag_Input","title":"Tag Function — tag_Input","text":"function creates tag","code":""},{"path":"/reference/tag_Input.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Tag Function — tag_Input","text":"","code":"tag_Input(inputId, text, colour = \"navy\")"},{"path":"/reference/tag_Input.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Tag Function — tag_Input","text":"inputId id access tag text text tag colour colour tag. Default navy. options grey, green, turquoise, blue, purple, pink, red, orange yellow","code":""},{"path":"/reference/tag_Input.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Tag Function — tag_Input","text":"tag html shiny object.","code":""},{"path":"/reference/tag_Input.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Tag Function — tag_Input","text":"","code":"if (interactive()) { ui <- fluidPage( shinyGovstyle::header( main_text = \"Example\", secondary_text = \"User Examples\", logo=\"shinyGovstyle/images/moj_logo.png\"), shinyGovstyle::gov_layout(size = \"two-thirds\", shinyGovstyle::tag_Input(\"tag1\", \"Complete\"), shinyGovstyle::tag_Input(\"tag2\", \"Incomplete\", \"red\")), shinyGovstyle::footer(full = TRUE) ) server <- function(input, output, session) {} shinyApp(ui = ui, server = server) }"},{"path":"/reference/text_Input.html","id":null,"dir":"Reference","previous_headings":"","what":"Text Input Function — text_Input","title":"Text Input Function — text_Input","text":"function create text area input","code":""},{"path":"/reference/text_Input.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Text Input Function — text_Input","text":"","code":"text_Input( inputId, label, hint_label = NULL, type = \"text\", width = NULL, error = FALSE, error_message = NULL, prefix = NULL, suffix = NULL )"},{"path":"/reference/text_Input.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Text Input Function — text_Input","text":"inputId input slot used access value. label Display label control, NULL label. hint_label Display hint label control, NULL hint label. type Type text input accept. Defaults text. width control size box based number characters required. Options 30, 20, 10, 5, 4, 3, 2. NULL limit size error Whenever include error handling Defaults FALSE. error_message Message display error. Defaults NULL prefix Add prefix box. Defaults NULL suffix Add suffix box. Defaults NULL","code":""},{"path":"/reference/text_Input.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Text Input Function — text_Input","text":"text input html shiny object","code":""},{"path":"/reference/text_Input.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Text Input Function — text_Input","text":"","code":"## Only run examples in interactive R sessions if (interactive()) { ui <- fluidPage( # Required for error handling function shinyjs::useShinyjs(), shinyGovstyle::header( main_text = \"Example\", secondary_text = \"User Examples\", logo=\"shinyGovstyle/images/moj_logo.png\"), shinyGovstyle::banner( inputId = \"banner\", type = \"beta\", 'This is a new service'), shinyGovstyle::gov_layout(size = \"two-thirds\", # Simple text box shinyGovstyle::text_Input(inputId = \"eventId\", label = \"Event Name\"), # Error text box shinyGovstyle::text_Input( inputId = \"eventId2\", label = \"Event Name\", hint_label = \"This can be found on the letter\", error = TRUE), # Button to trigger error shinyGovstyle::button_Input(inputId = \"submit\", label = \"Submit\") ), shinyGovstyle::footer(full = TRUE) ) server <- function(input, output, session) { #Trigger error on blank submit of eventId2 observeEvent(input$submit, { if (input$eventId2 != \"\"){ shinyGovstyle::error_off(inputId = \"eventId2\") } else { shinyGovstyle::error_on( inputId = \"eventId2\", error_message = \"Please complete\") } }) } # Run the application shinyApp(ui = ui, server = server) }"},{"path":"/reference/text_area_Input.html","id":null,"dir":"Reference","previous_headings":"","what":"Text Area Input Function — text_area_Input","title":"Text Area Input Function — text_area_Input","text":"function create text area input","code":""},{"path":"/reference/text_area_Input.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Text Area Input Function — text_area_Input","text":"","code":"text_area_Input( inputId, label, hint_label = NULL, row_no = 5, error = FALSE, error_message = NULL, word_limit = NULL )"},{"path":"/reference/text_area_Input.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Text Area Input Function — text_area_Input","text":"inputId input slot used access value. label Display label control, NULL label. hint_label Display hint label control, NULL hint label. row_no Size text entry box. Defaults 5. error Whenever icnlud error handling Defaults FALSE error_message Message display error. Defaults NULL word_limit Add word limit display. Defaults NULL.","code":""},{"path":"/reference/text_area_Input.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Text Area Input Function — text_area_Input","text":"text area box html shiny object","code":""},{"path":"/reference/text_area_Input.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Text Area Input Function — text_area_Input","text":"","code":"text_area_Input(\"taId\", \"Can you provide more detail?\", \"Do not include personal or financial information, like your National Insurance number or credit card details.\") #>
#>